diff --git a/data/discussions_test.json b/data/discussions_test.json new file mode 100644 index 0000000..4954664 --- /dev/null +++ b/data/discussions_test.json @@ -0,0 +1,18 @@ +[ + { + "author_id": "user_01", + "id": "420ed2cba1b47c1102a904a567470ccd", + "responses": [ + { + "author_id": "user_01", + "id": "59a713b0e41727182d4eba75d38f73f8", + "reactions": [], + "text": "response text", + "timestamp": "2024-04-28T23:00:04.447562" + } + ], + "text": "text", + "timestamp": "2024-04-28T23:00:04.447363", + "title": "Discssion Title" + } +] \ No newline at end of file diff --git a/data/quizzes_test.py b/data/quizzes_test.py new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/data/quizzes_test.py @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/test/quizzes_test.py b/test/quizzes_test.py index c4c1214..e770f4e 100644 --- a/test/quizzes_test.py +++ b/test/quizzes_test.py @@ -7,13 +7,30 @@ class QuizzesTest(unittest.TestCase): def setUp(self): # Run tests on non-production data self.ctrl = QuizzesController('quizzes_test.py') - + + # This test causes @quzzes_controller.py to crash on line 63 def test_expose_failure_01(self): - """ - Implement this function and two more that - execute the code and make it fail. - """ - self.assertTrue(True, 'Example assertion.') + self.ctrl.clear_data() + # with self.assertRaises(Exception): + # Attempt to add a quiz with invalid data + self.ctrl.add_quiz(None, None, None, None) + + + # This test causes @quzzes_controller.py to crash on line 117 + def test_expose_failure_02(self): + self.ctrl.clear_data() + # with self.assertRaises(Exception): + # Attempt to add a quiz with invalid data + self.ctrl.quizzes = -1 + self.ctrl.add_question(None, None, None) + + + # This test causes @quzzes_controller.py to crash on line 129 + def test_expose_failure_03(self): + self.ctrl.clear_data() + + self.ctrl.quizzes = -1 + self.ctrl.get_question_by_id('test') if __name__ == '__main__':