class TodoRouterTester(unittest.TestCase): def setUp(self): self.todo = TodoList() self.router = TodoRouter(self.todo) self.dummyItem = 'DO DAT THING' self.dummyItem2 = 'ANOTHER THING' def test_find_valid_route(self): cmds = ['add', 'complete', 'list', 'move'] funcs = [self.todo.add, self.todo.complete, self.todo.list_all, self.todo.move] for cmd, func in zip(cmds, funcs): self.assertEqual(self.router.route(cmd), func) def test_invalid_route(self): cmd = 'blah' self.assertEqual(self.router.route(cmd), None) pass
def setUp(self): self.todo = TodoList() self.router = TodoRouter(self.todo) self.dummyItem = 'DO DAT THING' self.dummyItem2 = 'ANOTHER THING'