Example #1
0
 def test_scroll_bottom_cursor_top(self):
     menu = Termenu(OPTIONS, height=3)
     menu.scroll = len(OPTIONS) - 3
     menu.cursor = 0
     assert strmenu(menu) == "(97) 98 99"
     menu._on_up()
     assert strmenu(menu) == "(96) 97 98"
Example #2
0
 def test_deselect(self):
     menu = Termenu(OPTIONS, height=4)
     assert strmenu(menu) == "(01) 02 03 04"
     menu._on_space()
     assert " ".join(menu.get_result()) == "01"
     menu._on_up()
     menu._on_space()
     assert strmenu(menu) == "01 (02) 03 04"
     assert " ".join(menu.get_result()) == "02"
Example #3
0
 def test_cursor_bottom(self):
     menu = Termenu(OPTIONS, height=3)
     menu.cursor = 2
     assert strmenu(menu) == "01 02 (03)"
     menu._on_up()
     assert strmenu(menu) == "01 (02) 03"
Example #4
0
 def test_cursor_middle(self):
     menu = Termenu(OPTIONS, height=3)
     menu.cursor = 1
     assert strmenu(menu) == "01 (02) 03"
     menu._on_up()
     assert strmenu(menu) == "(01) 02 03"
Example #5
0
 def test_cursor_top(self):
     menu = Termenu(OPTIONS, height=3)
     menu.cursor = 0
     assert strmenu(menu) == "(01) 02 03"
     menu._on_up()
     assert strmenu(menu) == "(01) 02 03"