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

Added 3 unit test to test quizzes controller. #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions test/quizzes_test.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import unittest

from app.controllers.quizzes_controller import QuizzesController
from app.controllers.activities_controller import ActivitiesController

class QuizzesTest(unittest.TestCase):

def setUp(self):
# Run tests on non-production data
self.ctrl = QuizzesController('quizzes_test.py')
self.activites = ActivitiesController()

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.')

# None is not a value that is handled within _save_data() method, which tries to loop over None
self.activites.activities = None
self.activites._save_data()
# This assert is not expected to be reached
self.assertEqual(self.activites.activities, None)

if __name__ == '__main__':
unittest.main()