mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 10:56:10 +00:00
Merge master: the modules moved into a package
Every file this branch touches moved into dikte/, so the merge is mostly the rename following the edits. What needed a hand: hotkey.py: master replaced the _macos()/_gnome() pair with one backend() chooser, and this branch had added _windows() to the pair. Windows is a fifth value of the chooser now, and everything that used to ask "macOS or Windows?" asks backend() instead. The key is held by the running process there, so installs_shortcuts() and shortcut_needs_restart() are both false for it, and desktop_name() says Windows. install.ps1 and the Windows README name dikte/__main__.py, the entry point the Linux and macOS installers were pointed at in the same commit. The Start Menu entry, the autostart entry and the dikte.cmd shim all come off one $entry variable. settings_ui.py: the shortcut tab now has a Windows sentence of its own, with the Turkish for it. Falling through to the branch master wrote for a desktop with no registry would have told a Windows user to check /dev/input. Nothing covers that branch: there is no Windows Settings test class, the way there is one for macOS. CONTRIBUTING: the chooser it names is backend() now, and the test count is the merged one, 1067 of 1110 running anywhere.
This commit is contained in:
+16
-8
@@ -12,13 +12,13 @@ import json
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
import audio
|
||||
import cli
|
||||
import config as cfg
|
||||
import ggml
|
||||
import hotkey
|
||||
import ipc
|
||||
import paste
|
||||
from dikte import audio
|
||||
from dikte import cli
|
||||
from dikte import config as cfg
|
||||
from dikte import ggml
|
||||
from dikte import hotkey
|
||||
from dikte import ipc
|
||||
from dikte import paste
|
||||
from tests.support import DikteTest, fake_urlopen, only_these_tools
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ class Parser(unittest.TestCase):
|
||||
name)
|
||||
|
||||
def test_every_verb_is_wired_to_something(self):
|
||||
for verb in ("record", "toggle", "start", "stop", "cancel", "ask",
|
||||
for verb in ("record", "toggle", "start", "stop", "pause", "cancel", "ask",
|
||||
"session", "transcribe", "meeting", "meetings", "history",
|
||||
"config", "prompt", "devices", "models", "test-key",
|
||||
"doctor", "shortcut", "status", "settings", "restart",
|
||||
@@ -660,6 +660,14 @@ class Replies(DikteTest):
|
||||
captured():
|
||||
self.assertEqual(cli.run(["cancel"]), 0)
|
||||
|
||||
def test_pausing_a_recording_nobody_started_is_not_a_failure_either(self):
|
||||
"""A key that pauses can be pressed when there is nothing to pause, and
|
||||
it must not start an application to tell you so."""
|
||||
with mock.patch.object(ipc, "send", return_value=None), \
|
||||
mock.patch.object(cli, "launch_gui") as launched, captured():
|
||||
self.assertEqual(cli.run(["pause"]), 0)
|
||||
self.assertFalse(launched.called)
|
||||
|
||||
|
||||
class TranscribeRunsHere(DikteTest):
|
||||
"""`dikte transcribe` runs in this process, not in the instance."""
|
||||
|
||||
Reference in New Issue
Block a user