1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-27 19:42:53 +03:00
Files
certbot/tests/display.py
Brad Warren ae379568b1 Mitigate problems for people who run without -n (#3916)
* CLI flag for forcing interactivity

* add --force-interactive

* Add force_interactive error checking and tests

* Add force_interactive parameter to FileDisplay

* add _can_interact

* Add _return_default

* Add **unused_kwargs to NoninteractiveDisplay

* improve _return_default assertion

* Change IDisplay calls and write tests

* Document force_interactive in interfaces.py

* Don't force_interactive with a new prompt

* Warn when skipping an interaction for the first time

* add specific logger.debug message
2016-12-19 12:45:40 -08:00

23 lines
840 B
Python

"""Manual test of display functions."""
import sys
from certbot.display import util
from certbot.tests.display import util_test
def test_visual(displayer, choices):
"""Visually test all of the display functions."""
displayer.notification("Random notification!")
displayer.menu("Question?", choices,
ok_label="O", cancel_label="Can", help_label="??")
displayer.menu("Question?", [choice[1] for choice in choices],
ok_label="O", cancel_label="Can", help_label="??")
displayer.input("Input Message")
displayer.yesno("YesNo Message", yes_label="Yessir", no_label="Nosir")
displayer.checklist("Checklist Message", [choice[0] for choice in choices])
if __name__ == "__main__":
displayer = util.FileDisplay(sys.stdout, False)
test_visual(displayer, util_test.CHOICES)