aboutsummaryrefslogtreecommitdiff
path: root/tests/test_tts.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_tts.py')
-rw-r--r--tests/test_tts.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/test_tts.py b/tests/test_tts.py
index bebbaf6..89248f2 100644
--- a/tests/test_tts.py
+++ b/tests/test_tts.py
@@ -1142,19 +1142,21 @@ class BackendWiringTests(unittest.TestCase):
voice="narrator", language=config.LANGUAGE,
chunk_text=False, model_id="higgs")
- def test_gradio_backend_uses_qwen_client(self):
+ def test_qwen_backend_uses_qwen_client(self):
with patch("converter.converter.FasterTTSClient") as mock_faster, \
patch("converter.converter.QwenTTSClient") as mock_qwen, \
patch("converter.converter.AudioCppTTSClient") as mock_audiocpp:
- AudiobookConverter(voice_mode=tts.VOICE_MODE_CUSTOM)
+ AudiobookConverter(voice_mode=tts.VOICE_MODE_CUSTOM,
+ backend=tts.BACKEND_QWEN)
mock_qwen.assert_called_once()
mock_faster.assert_not_called()
mock_audiocpp.assert_not_called()
- def test_gradio_clone_mode_still_requires_reference(self):
+ def test_qwen_clone_mode_still_requires_reference(self):
with patch("converter.converter.QwenTTSClient"):
with self.assertRaises(ValueError):
- AudiobookConverter(voice_mode=tts.VOICE_MODE_CLONE)
+ AudiobookConverter(voice_mode=tts.VOICE_MODE_CLONE,
+ backend=tts.BACKEND_QWEN)
def test_audiocpp_clone_mode_does_not_require_reference(self):
# Cloning is server-side for the audiocpp backend, so the
@@ -1182,9 +1184,10 @@ class BackendWiringTests(unittest.TestCase):
self.assertGreater(len(chunks), 1)
self.assertTrue(all(len(chunk.split()) <= 10 for chunk in chunks))
- def test_chapter_chunks_gradio_always_splits(self):
+ def test_chapter_chunks_qwen_always_splits(self):
with patch("converter.converter.QwenTTSClient"):
- converter = AudiobookConverter(voice_mode=tts.VOICE_MODE_CUSTOM)
+ converter = AudiobookConverter(voice_mode=tts.VOICE_MODE_CUSTOM,
+ backend=tts.BACKEND_QWEN)
text = " ".join(f"word{i}" for i in range(50))
with patch.object(config, "CHUNK_SIZE", 10):
chunks = converter._chapter_chunks(text)
@@ -1257,7 +1260,8 @@ class BackendWiringTests(unittest.TestCase):
ref.write_bytes(b"x")
with patch("converter.converter.QwenTTSClient"):
converter = AudiobookConverter(voice_mode=tts.VOICE_MODE_CLONE,
- voice_clone_ref_audio=str(ref))
+ voice_clone_ref_audio=str(ref),
+ backend=tts.BACKEND_QWEN)
self.assertEqual(converter._narrator_tag(), "ref")