def test_Exam_addQuestion_bad_question(self): myExam = Exam() try: myExam.addQuestion(self.myBadQuestion) except ValueError: pass # When input is bad, nothing should be added. self.assertEqual(myExam.getQuestions(), [])
def test_Exam_addQuestion_good_question(self): myExam = Exam() myExam.addQuestion(self.myGoodQuestion) self.assertEqual(myExam.getQuestions(), [self.myGoodQuestion])