Wire the TUI Days field through to build-client-full
This commit is contained in:
@@ -90,3 +90,22 @@ def test_tui_skipped_revoke_build_failure_does_not_claim_revocation(monkeypatch)
|
||||
lambda self, stdscr, text: shown.append(text))
|
||||
app._process_cert(_stdscr(), "y.kuts", "", is_renewal=True)
|
||||
assert shown and "has been revoked" not in shown[0]
|
||||
|
||||
|
||||
def test_tui_seeds_days_field_from_cert_days(monkeypatch):
|
||||
import openvpncertupdate as m
|
||||
_patch_workflow(monkeypatch, cert_file_present=True)
|
||||
monkeypatch.setattr("openvpncertupdate.CERT_DAYS", "90")
|
||||
CursesApp()._process_cert(_stdscr(), "y.kuts", "", is_renewal=True)
|
||||
assert m.show_cert_form.call_args.kwargs["days"] == "90"
|
||||
|
||||
|
||||
def test_tui_forwards_form_days_to_build_client_full(monkeypatch):
|
||||
mocks = _patch_workflow(monkeypatch, cert_file_present=True)
|
||||
monkeypatch.setattr(
|
||||
"openvpncertupdate.show_cert_form",
|
||||
MagicMock(return_value=CertFormResult(
|
||||
cn="y.kuts", email="", password="Testpass1234567890abcdefgh",
|
||||
days="30", confirmed=True)))
|
||||
CursesApp()._process_cert(_stdscr(), "y.kuts", "", is_renewal=True)
|
||||
assert mocks["build_client_full"].call_args.kwargs["days"] == "30"
|
||||
|
||||
Reference in New Issue
Block a user