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