aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_tts.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_tts.py b/tests/test_tts.py
index f2dda0e..9ca6f0d 100644
--- a/tests/test_tts.py
+++ b/tests/test_tts.py
@@ -657,6 +657,35 @@ class AudioCppTTSClientHealthTests(unittest.TestCase):
client = self._client(voice="narrator")
self.assertEqual(client.model_id, config.AUDIOCPP_MODEL_ID)
+ def test_preset_mode_with_clone_only_server_uses_clone_model(self):
+ with patch.object(config, "AUDIOCPP_MODEL_ID", "qwen3-tts"), \
+ patch.object(config, "AUDIOCPP_CLONE_MODEL_ID", "qwen3-tts-clone"):
+ client = self._client(
+ voice="narrator",
+ models={"data": [{"id": "qwen3-tts-clone"}]})
+ self.assertEqual(client.model_id, "qwen3-tts-clone")
+
+ def test_speaker_mode_with_clone_only_server_suggests_voice(self):
+ with patch.object(config, "AUDIOCPP_MODEL_ID", "qwen3-tts"), \
+ patch.object(config, "AUDIOCPP_CLONE_MODEL_ID", "qwen3-tts-clone"):
+ with self.assertRaises(RuntimeError) as ctx:
+ self._client(models={"data": [{"id": "qwen3-tts-clone"}]})
+ message = str(ctx.exception)
+ self.assertIn("qwen3-tts", message)
+ self.assertIn("--voice", message)
+
+ def test_preset_mode_with_no_matching_model_lists_both_ids(self):
+ with patch.object(config, "AUDIOCPP_MODEL_ID", "qwen3-tts"), \
+ patch.object(config, "AUDIOCPP_CLONE_MODEL_ID", "qwen3-tts-clone"), \
+ self.assertLogs("converter.tts", level="WARNING"):
+ with self.assertRaises(RuntimeError) as ctx:
+ self._client(voice="narrator",
+ models={"data": [{"id": "pocket-tts"}]})
+ message = str(ctx.exception)
+ self.assertIn("qwen3-tts", message)
+ self.assertIn("qwen3-tts-clone", message)
+ self.assertIn("pocket-tts", message)
+
class AudioCppTTSClientRequestTests(unittest.TestCase):
"""The /v1/audio/speech payload and response validation."""