2015-06-28 05:31:42 -04:00
|
|
|
"""Manual test of display functions."""
|
|
|
|
|
import sys
|
|
|
|
|
|
2016-04-13 19:45:54 -04:00
|
|
|
from certbot.display import util
|
|
|
|
|
from certbot.tests.display import util_test
|
2015-06-28 05:31:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
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__":
|
2016-12-19 15:45:40 -05:00
|
|
|
displayer = util.FileDisplay(sys.stdout, False)
|
2016-10-21 18:45:57 -04:00
|
|
|
test_visual(displayer, util_test.CHOICES)
|