diff options
| author | Yuval Adam <_@yuv.al> | 2026-07-24 13:14:36 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2026-07-24 13:14:36 +0200 |
| commit | df780f6aa210f0916323dd3eb925d762dbb0769d (patch) | |
| tree | 6a23d3845a14c1b61052e47841b846058420650e /tests | |
| parent | f2197687e18eb129fcf25462943aa75972560579 (diff) | |
Modernize GLib and D-Bus integrations
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_controller.py | 5 | ||||
| -rw-r--r-- | tests/test_persistence.py | 8 | ||||
| -rw-r--r-- | tests/test_transcription.py | 12 |
3 files changed, 15 insertions, 10 deletions
diff --git a/tests/test_controller.py b/tests/test_controller.py index 61c291e..b57cb69 100644 --- a/tests/test_controller.py +++ b/tests/test_controller.py @@ -55,7 +55,10 @@ class ControllerTests(unittest.TestCase): received = [] controller = Controller( self.config, - on_transcript=lambda text, path: (received.append((text, path)), ready.set()), + on_transcript=lambda text, path: ( + received.append((text, path)), + ready.set(), + ), ) controller.recorder = FakeRecorder() controller.transcriber = FakeTranscriber() diff --git a/tests/test_persistence.py b/tests/test_persistence.py index eecb378..d8ae257 100644 --- a/tests/test_persistence.py +++ b/tests/test_persistence.py @@ -18,9 +18,7 @@ class PersistenceTests(unittest.TestCase): def test_writes_utf8_with_one_final_newline(self) -> None: path = save_transcript("héllo\n\n", self.directory, clock=lambda: self.now) self.assertEqual(path.read_text(encoding="utf-8"), "héllo\n") - self.assertEqual( - path.name, "transcript_2026-07-24_12-34-56_123456+0000.txt" - ) + self.assertEqual(path.name, "transcript_2026-07-24_12-34-56_123456+0000.txt") def test_uses_counter_on_collision(self) -> None: first = save_transcript("one", self.directory, clock=lambda: self.now) @@ -32,7 +30,9 @@ class PersistenceTests(unittest.TestCase): def test_leaves_no_temporary_file(self) -> None: save_transcript("text", self.directory, clock=lambda: self.now) - self.assertFalse(any(path.suffix == ".tmp" for path in self.directory.iterdir())) + self.assertFalse( + any(path.suffix == ".tmp" for path in self.directory.iterdir()) + ) if __name__ == "__main__": diff --git a/tests/test_transcription.py b/tests/test_transcription.py index 916aac2..e79bb2b 100644 --- a/tests/test_transcription.py +++ b/tests/test_transcription.py @@ -6,11 +6,13 @@ from parley.transcription import parse_jsonl class ParseJsonlTests(unittest.TestCase): def test_skips_header_and_malformed_lines(self) -> None: - output = '\n'.join([ - 'runtime diagnostic', - '{"type":"batch_header","count":1}', - '{"file":"recording.wav","text":"hello world"}', - ]) + output = "\n".join( + [ + "runtime diagnostic", + '{"type":"batch_header","count":1}', + '{"file":"recording.wav","text":"hello world"}', + ] + ) self.assertEqual(parse_jsonl(output), "hello world") def test_reports_error_row(self) -> None: |
