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_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_select(self): entries = [("A","a"),("B","b"),("C","c")] m = Menu(entries) self.assertEqual(m.select(),"a") m.scroll('down') self.assertEqual(m.select(),"b") m.scroll('down') self.assertEqual(m.select(),"c")
def test_scroll_double_up(self): entries = [("A","a"),("B","b"),("C","c")] m = Menu(entries) m._select_line = 1 m._display_start = 1 m.scroll('up') m.scroll('up') lines = m.get_display() self.assertEqual(lines[0],">A") self.assertEqual(lines[1]," B")