diff --git a/tests/test_dialogs.py b/tests/test_dialogs.py index ffd67d6..1bc8c58 100644 --- a/tests/test_dialogs.py +++ b/tests/test_dialogs.py @@ -116,16 +116,23 @@ def test_show_cert_form_uses_erase_not_clear(): def test_show_cert_form_confirm(): """Enter advances through the 4 fields to the Continue button; Enter on - Continue confirms. That's 5 Enter keypresses total.""" + Continue confirms. That's 5 Enter keypresses total. + + days="90" (non-blank) is used deliberately: a blank default would still + read back as "" even from a reverted three-field form (CertFormResult.days + defaults to ""), so it would not actually prove the days field was + traversed. A non-blank value only round-trips if the days field exists, + was reached by the Enter sequence, and was carried into the result.""" stdscr = _make_stdscr() win = _make_win(rows=20, cols=70) win.getch.side_effect = [10, 10, 10, 10, 10] with patch("curses.newwin", return_value=win): - result = show_cert_form(stdscr, cn="bob", email="bob@example.com") + result = show_cert_form(stdscr, cn="bob", email="bob@example.com", days="90") assert isinstance(result, CertFormResult) assert result.confirmed is True assert result.cn == "bob" assert result.email == "bob@example.com" + assert result.days == "90" assert len(result.password) > 0