diff options
| author | historia <historiavg@proton.me> | 2026-09-02 01:26:09 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-09-02 01:26:09 -0400 |
| commit | 8579517a35ef1865fc9b428899d73d52dcb27a14 (patch) | |
| tree | dba52f8d99cfe4014e0b787367de99f238e5a0db /app/tests/test_tui.py | |
| parent | 391f50da7a085bec75155c0eb9b47910266058cc (diff) | |
| download | tts-audiobook-generator-8579517a35ef1865fc9b428899d73d52dcb27a14.tar.gz | |
feat: sglang backend support
Diffstat (limited to 'app/tests/test_tui.py')
| -rw-r--r-- | app/tests/test_tui.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/tests/test_tui.py b/app/tests/test_tui.py index e3383cb..ea2dd79 100644 --- a/app/tests/test_tui.py +++ b/app/tests/test_tui.py @@ -1303,6 +1303,25 @@ class CheckboxTreeTests(TuiTestCase): start_on_buttons=True) self.assertEqual(picked, [(0, "pkg-a")]) + def test_allow_empty_confirms_with_nothing_checked(self): + # allow_empty=True: Confirm on an empty tree returns [] instead + # of flashing — a meaningful answer for pickers where unchecking + # means removing. (Tab first: the focus starts on the rows.) + screen = FakeScreen(keys=[9, 10]) + self.assertEqual( + tui.checkbox_tree(screen, "Pick models", self.FAMILIES, + allow_empty=True), []) + + def test_allow_empty_accepts_a_fully_unchecked_tree(self): + # The modify flow: a pre-checked option is unchecked (Down Down + # Space), then Confirm accepts the now-empty selection. + screen = FakeScreen(keys=[FakeCurses.KEY_DOWN, FakeCurses.KEY_DOWN, + ord(" "), 9, 10]) + picked = tui.checkbox_tree( + screen, "Pick models", self.FAMILIES, + checked={(0, "pkg-b")}, allow_empty=True) + self.assertEqual(picked, []) + def test_prechecked_options_draw_as_checked(self): screen = FakeScreen(keys=[9, 10]) tui.checkbox_tree(screen, "Pick models", self.FAMILIES, |
