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_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_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")