diff --git a/TDD/test_to_do_list.py b/TDD/test_to_do_list.py index 6d60655..e6898d8 100644 --- a/TDD/test_to_do_list.py +++ b/TDD/test_to_do_list.py @@ -10,28 +10,30 @@ class TestToDoList(unittest.TestCase): # type checking tests def test_if_title_is_an_str_instance_getting_an_assertion_error(self): with self.assertRaises(Exception) as ex: - ToDoList.add_item(0, '11/11/1111', '00:00', None) + ToDoList.add_event(0, '11/11/1111', '00:00', None) self.assertEqual(ex.exception.args[0], 'Title is not an str instance.') def test_if_date_is_an_str_instance_getting_an_assertion_error(self): with self.assertRaises(Exception) as ex: - ToDoList.add_item('title', 1, '00:00', None) + ToDoList.add_event('title', 1, '00:00', None) self.assertEqual(ex.exception.args[0], 'Date is not an str instance.') def test_if_time_is_an_str_instance_getting_an_assertion_error(self): with self.assertRaises(Exception) as ex: - ToDoList.add_item('title', '11/11/1111', 0, None) + ToDoList.add_event('title', '11/11/1111', 0, None) self.assertEqual(ex.exception.args[0], 'Time is not an str instance.') - def test_if_description_is_an_str_instance_or_none_value_getting_an_assertion_error(self): with self.assertRaises(Exception) as ex: - ToDoList.add_item('title', '11/11/1111', '00:00', 0) + ToDoList.add_event('title', '11/11/1111', '00:00', 0) self.assertEqual(ex.exception.args[0], 'Description is not an str instance or none value.') - def test_if_date_can_be_converted_to_datetime_with_strptime_function_raises_an_error(self): + def test__converting_str_to_date_function_getting_an_assertion_error(self): with self.assertRaises(Exception) as ex: - self.assertEqual(ToDoList.add_item('test_item', '11|11|1111', '00:00', None), 'time data does not march with the default format.') + self.assertEqual(ToDoList.add_event('test_item', '1111/11/11', '00:00', None), 'Date does not match with the default format.') + + def test_creating_a_dictionare_for_each_event(self): + self.assertTrue(isinstance(ToDoList.add_event('event test', '11/11/1111', '00:00', 'a test event'), dict)) if __name__ == '__main__':