def test_get_item_error(self): quarter = TodoQuarter() with self.assertRaises(IndexError, msg='Index out of range list todo_items'): quarter.get_item(5)
def test_get_item(self): date = datetime(2017, 7, 4) quarter = TodoQuarter() quarter.add_item('implement Quarter Class', date) item = quarter.get_item(0) self.assertIsInstance(item, TodoItem)