mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Merge master: the downloadable builds
Three files disagreed. The test workflow gained a job on either side, so both stay: the Mac now parses the release and packaging scripts as well, and Windows keeps its own job below. `restart` and `launch_gui` both start Dikte again, and master moved that argv into `ipc.launcher()` because a packaged build has no `__main__.py` to name. Windows still cannot use execv there, so the detached start it needs now takes what the launcher hands it rather than spelling the interpreter and the script itself. The test counts in CONTRIBUTING are the suite as it stands after the merge: 1104 of 1147 run anywhere, and the 43 left are the Linux ones.
This commit is contained in:
@@ -69,6 +69,30 @@ class Paths(unittest.TestCase):
|
||||
self.assertTrue(command.startswith(sys.executable))
|
||||
self.assertTrue(command.endswith(" toggle"))
|
||||
|
||||
def test_a_packaged_build_names_itself_and_no_interpreter(self):
|
||||
"""There is no __main__.py on disk in one, and sys.executable is the
|
||||
build's own binary rather than a Python anybody could run it with."""
|
||||
with mock.patch.object(sys, "frozen", True, create=True), \
|
||||
mock.patch.object(sys, "executable", "/Applications/Dikte.app/Contents/MacOS/Dikte"), \
|
||||
mock.patch.dict(os.environ, {}, clear=True):
|
||||
self.assertEqual(ipc.launcher(),
|
||||
["/Applications/Dikte.app/Contents/MacOS/Dikte"])
|
||||
|
||||
def test_an_appimage_names_the_file_rather_than_this_run_s_mount(self):
|
||||
"""A shortcut written to the mount works until the next login."""
|
||||
with mock.patch.object(sys, "frozen", True, create=True), \
|
||||
mock.patch.object(sys, "executable", "/tmp/.mount_ab12/usr/bin/dikte"), \
|
||||
mock.patch.dict(os.environ, {"APPIMAGE": "/home/me/Dikte.AppImage"}):
|
||||
self.assertEqual(ipc.command_for("toggle"),
|
||||
"/home/me/Dikte.AppImage toggle")
|
||||
|
||||
def test_a_path_with_a_space_in_it_is_quoted(self):
|
||||
"""Which is every Mac, and an AppImage kept anywhere with a name."""
|
||||
with mock.patch.object(sys, "frozen", True, create=True), \
|
||||
mock.patch.dict(os.environ, {"APPIMAGE": "/home/me/My Things/Dikte.AppImage"}):
|
||||
self.assertEqual(ipc.command_for("cancel"),
|
||||
"'/home/me/My Things/Dikte.AppImage' cancel")
|
||||
|
||||
@unittest.skipUnless(hasattr(os, "getuid"),
|
||||
"the socket is named after a user id, which Windows "
|
||||
"has no equivalent of")
|
||||
|
||||
Reference in New Issue
Block a user