def METHOD_NAME(tmp_work_path):
    with open("foo.desktop", "w") as desktop_file:
        print("[Random Entry]", file=desktop_file)
        print("Exec=foo", file=desktop_file)
        print("Icon=foo", file=desktop_file)
    d = DesktopFile(
        snap_name="foo",
        app_name="foo",
        filename="foo.desktop",
        prime_dir=tmp_work_path.as_posix(),
    )
    with pytest.raises(errors.InvalidDesktopFileError):
        d.write(gui_dir=tmp_work_path.as_posix())