aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_runview.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-09-02 20:33:44 -0400
committerhistoria <historiavg@proton.me>2026-09-02 20:33:44 -0400
commitdfce6c38a9a67ea2760fedae73ee9f5989d52f13 (patch)
tree4212258c63908201c9720d016f0ea86d7f209aae /app/tests/test_runview.py
parent08e702700303f9bb5767f02a337b8b34be410df9 (diff)
downloadtts-audiobook-generator-dfce6c38a9a67ea2760fedae73ee9f5989d52f13.tar.gz
feat: add model and voice labels to generate audiobooks status tui
Diffstat (limited to 'app/tests/test_runview.py')
-rw-r--r--app/tests/test_runview.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/app/tests/test_runview.py b/app/tests/test_runview.py
index 7f79053..501f1f7 100644
--- a/app/tests/test_runview.py
+++ b/app/tests/test_runview.py
@@ -419,6 +419,43 @@ class RenderTests(_FakeTui, unittest.TestCase):
self.assertIn("starting", text)
self.assertIn("Esc or q: cancel", text)
+ def test_title_says_generating_audiobooks(self):
+ view, screen = self.make_view()
+ view.render()
+ self.assertIn("Generating audiobooks", self._strings(screen))
+
+ def test_model_and_voice_rows_draw_between_server_and_status(self):
+ # The form's picks ride the config as display-only labels, drawn
+ # between the Server and Status header rows.
+ view, screen = self.make_view(model_label="qwen3_tts",
+ voice_label="Vivian")
+ view.render()
+ labels = [text.strip() for _y, _x, text, _ in screen.strings
+ if text.strip() in ("Server", "Model", "Voice", "Status")]
+ self.assertEqual(labels, ["Server", "Model", "Voice", "Status"])
+ text = self._strings(screen)
+ self.assertIn("qwen3_tts", text)
+ self.assertIn("Vivian", text)
+
+ def test_voice_only_row_draws_without_a_model_row(self):
+ # faster has no model pick: only the Voice row appears.
+ view, screen = self.make_view(model_label="",
+ voice_label="narrator")
+ view.render()
+ labels = [text.strip() for _y, _x, text, _ in screen.strings]
+ self.assertNotIn("Model", labels)
+ self.assertIn("Voice", labels)
+ self.assertIn("narrator", self._strings(screen))
+
+ def test_model_and_voice_rows_hidden_when_not_applicable(self):
+ # No picks recorded (or none apply): no rows, so the header keeps
+ # its Server -> Status shape.
+ view, screen = self.make_view()
+ view.render()
+ labels = [text.strip() for _y, _x, text, _ in screen.strings]
+ self.assertNotIn("Model", labels)
+ self.assertNotIn("Voice", labels)
+
def test_ready_without_autostart_shows_the_not_started_tag(self):
# A run that talks to a server it did not start (already running
# locally, or remote) tags the ready state so the panel does not