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_removeQuestion_valid(self): myExam = Exam() # Seems to reuse myExam from earlier...? myExam.removeQuestion(search=0, questionIndex=True) self.assertEqual(myExam.getQuestions(), [])
def test_Exam_addQuestion_good_question(self): myExam = Exam() myExam.addQuestion(self.myGoodQuestion) self.assertEqual(myExam.getQuestions(), [self.myGoodQuestion])