/ tests / display.py
display.py
 1  """Manual test of display functions."""
 2  import sys
 3  
 4  from letsencrypt.display import util
 5  from letsencrypt.tests.display import util_test
 6  
 7  
 8  def test_visual(displayer, choices):
 9      """Visually test all of the display functions."""
10      displayer.notification("Random notification!")
11      displayer.menu("Question?", choices,
12                     ok_label="O", cancel_label="Can", help_label="??")
13      displayer.menu("Question?", [choice[1] for choice in choices],
14                     ok_label="O", cancel_label="Can", help_label="??")
15      displayer.input("Input Message")
16      displayer.yesno("YesNo Message", yes_label="Yessir", no_label="Nosir")
17      displayer.checklist("Checklist Message", [choice[0] for choice in choices])
18  
19  
20  if __name__ == "__main__":
21      for displayer in util.NcursesDisplay(), util.FileDisplay(sys.stdout):
22          test_visual(displayer, util_test.CHOICES)