diff options
| author | historia <historiavg@proton.me> | 2026-08-21 14:28:42 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-21 14:28:42 -0400 |
| commit | 9d2c24edb983e458b0fbb9f065fbbda79c19ca26 (patch) | |
| tree | 8286decf2080bbd61c812dfab5d7dbe1ad1f94d5 /tests/test_converter.py | |
| parent | e5c722e9fc67f20c1545f79bb4bbc0188dea7d1f (diff) | |
| download | tts-audiobook-generator-9d2c24edb983e458b0fbb9f065fbbda79c19ca26.tar.gz | |
rename project tts-audiobook generator, doc cleanup
Diffstat (limited to 'tests/test_converter.py')
| -rw-r--r-- | tests/test_converter.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/test_converter.py b/tests/test_converter.py index e7c0776..f09e151 100644 --- a/tests/test_converter.py +++ b/tests/test_converter.py @@ -56,17 +56,17 @@ class ConfigurationValidationTests(unittest.TestCase): def test_language_defaults_to_config(self): with patch("converter.converter.QwenTTSClient") as mock_tts: - AudiobookConverter() + AudiobookConverter(backend=tts.BACKEND_QWEN) self.assertEqual(mock_tts.call_args.kwargs["language"], config.LANGUAGE) def test_output_format_defaults_to_config(self): with patch("converter.converter.QwenTTSClient"): - converter = AudiobookConverter() + converter = AudiobookConverter(backend=tts.BACKEND_QWEN) self.assertEqual(converter.output_format, config.AUDIO_FORMAT) def test_language_normalized_before_tts_client(self): with patch("converter.converter.QwenTTSClient") as mock_tts: - converter = AudiobookConverter(language="ja") + converter = AudiobookConverter(language="ja", backend=tts.BACKEND_QWEN) self.assertEqual(converter.language, "Japanese") self.assertEqual(mock_tts.call_args.kwargs["language"], "Japanese") @@ -129,7 +129,7 @@ class NarratorTagTests(unittest.TestCase): converter = AudiobookConverter.__new__(AudiobookConverter) converter.voice_mode = voice_mode converter.voice_clone_ref_audio = ref_audio - converter.backend = tts.BACKEND_GRADIO + converter.backend = tts.BACKEND_QWEN converter.voice = None return converter @@ -274,8 +274,8 @@ class DebugDumpTests(unittest.TestCase): def test_debug_flag_wiring(self): with patch("converter.converter.QwenTTSClient"): - self.assertFalse(AudiobookConverter().debug) - self.assertTrue(AudiobookConverter(debug=True).debug) + self.assertFalse(AudiobookConverter(backend=tts.BACKEND_QWEN).debug) + self.assertTrue(AudiobookConverter(debug=True, backend=tts.BACKEND_QWEN).debug) class SetupLoggingTests(unittest.TestCase): @@ -496,14 +496,14 @@ class PreflightOverwritesTests(unittest.TestCase): (converter_mod.BOOKS_FOLDER / "book.txt").unlink() with patch("builtins.input", side_effect=AssertionError("should not prompt")): book_files, planned = AudiobookConverter.preflight_overwrites( - tts.BACKEND_GRADIO, None, tts.VOICE_MODE_CUSTOM, None, "mp3") + tts.BACKEND_QWEN, None, tts.VOICE_MODE_CUSTOM, None, "mp3") self.assertEqual(book_files, []) self.assertEqual(planned, []) def test_new_book_planned_without_prompt(self): with patch("builtins.input", side_effect=AssertionError("should not prompt")): book_files, planned = AudiobookConverter.preflight_overwrites( - tts.BACKEND_GRADIO, None, tts.VOICE_MODE_CUSTOM, None, "mp3") + tts.BACKEND_QWEN, None, tts.VOICE_MODE_CUSTOM, None, "mp3") self.assertEqual(len(book_files), 1) self.assertEqual(planned, [(book_files[0], "book_Vivian")]) @@ -511,14 +511,14 @@ class PreflightOverwritesTests(unittest.TestCase): (converter_mod.AUDIOBOOKS_FOLDER / "book_Vivian.mp3").write_bytes(b"existing") with patch("builtins.input", return_value=""): book_files, planned = AudiobookConverter.preflight_overwrites( - tts.BACKEND_GRADIO, None, tts.VOICE_MODE_CUSTOM, None, "mp3") + tts.BACKEND_QWEN, None, tts.VOICE_MODE_CUSTOM, None, "mp3") self.assertEqual(planned, [(book_files[0], "book_Vivian")]) def test_existing_output_declined_is_skipped(self): (converter_mod.AUDIOBOOKS_FOLDER / "book_Vivian.mp3").write_bytes(b"existing") with patch("builtins.input", return_value="n"): book_files, planned = AudiobookConverter.preflight_overwrites( - tts.BACKEND_GRADIO, None, tts.VOICE_MODE_CUSTOM, None, "mp3") + tts.BACKEND_QWEN, None, tts.VOICE_MODE_CUSTOM, None, "mp3") self.assertEqual(len(book_files), 1) self.assertEqual(planned, []) @@ -536,7 +536,7 @@ class RunOverwritePromptTests(unittest.TestCase): self.converter = AudiobookConverter.__new__(AudiobookConverter) self.converter.voice_mode = tts.VOICE_MODE_CUSTOM self.converter.voice_clone_ref_audio = None - self.converter.backend = tts.BACKEND_GRADIO + self.converter.backend = tts.BACKEND_QWEN self.converter.voice = None self.converter.speed = 1.0 self.converter.single_file = False |
