From dfce6c38a9a67ea2760fedae73ee9f5989d52f13 Mon Sep 17 00:00:00 2001 From: historia Date: Wed, 2 Sep 2026 20:33:44 -0400 Subject: feat: add model and voice labels to generate audiobooks status tui --- app/tests/test_runview.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'app/tests/test_runview.py') 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 -- cgit v1.2.3