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"
def test_scroll_bottom_cursor_bottom(self): menu = Termenu(OPTIONS, height=4) menu.scroll = len(OPTIONS) - 4 menu.cursor = 3 assert strmenu(menu) == "96 97 98 (99)" menu._on_pageDown() assert strmenu(menu) == "96 97 98 (99)"
def test_scroll_bottom_cursor_bottom(self): menu = Termenu(OPTIONS, height=3) menu.scroll = len(OPTIONS) - 3 menu.cursor = 2 assert strmenu(menu) == "97 98 (99)" menu._on_down() assert strmenu(menu) == "97 98 (99)"
def test_more_below_none(self): menu = Termenu(OPTIONS, height=4) menu.scroll = len(OPTIONS) - 4 assert [menu._decorate_flags(i)["moreBelow"] for i in range(4)] == [False, False, False, False]
def test_more_above_one(self): menu = Termenu(OPTIONS, height=4) menu.scroll = 1 assert [menu._decorate_flags(i)["moreAbove"] for i in range(4)] == [True, False, False, False]
def test_scroll_almost_top_cursor_top(self): menu = Termenu(OPTIONS, height=4) menu.scroll = 1 assert strmenu(menu) == "(02) 03 04 05" menu._on_pageUp() assert strmenu(menu) == "(01) 02 03 04"
def test_scroll_bottom_cursor_top(self): menu = Termenu(OPTIONS, height=4) menu.scroll = len(OPTIONS) - 4 assert strmenu(menu) == "(96) 97 98 99" menu._on_pageUp() assert strmenu(menu) == "(92) 93 94 95"