Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team_3_Deliverable_E #27

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions data/discussions_test.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
1 change: 1 addition & 0 deletions data/quizzes_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
29 changes: 23 additions & 6 deletions test/quizzes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down