def test_get_display(self): entries = [("A","a"),("B","b"),("C","c")] m = Menu(entries) lines = m.get_display() self.assertEqual(len(lines),2) self.assertEqual(lines[0],">A") self.assertEqual(lines[1]," B")
def test_scroll_down(self): entries = [("A","a"),("B","b"),("C","c")] m = Menu(entries) m.scroll('down') lines = m.get_display() self.assertEqual(lines[0]," A") self.assertEqual(lines[1],">B")
def test_scroll_up(self): entries = [("A","a"),("B","b"),("C","c")] m = Menu(entries) m._select_line = 1 m.scroll('up') lines = m.get_display() self.assertEqual(lines[0],">A") self.assertEqual(lines[1]," B")
def test_scroll_display_double_up(self): entries = [("A","a"),("B","b"),("C","c")] m = Menu(entries) m._display_start = 1 m.scroll_display('up') m.scroll_display('up') lines = m.get_display() self.assertEqual(lines[0],">A") self.assertEqual(lines[1]," B")