Beispiel #1
0
 def test_add_student(self, mock_input):
     crud.add_student()
     with open("students.txt", 'r') as file_object:
         students_info = file_object.read()
         self.assertEqual("Yongju Kwon A01059334 True \n",
                          students_info)
     crud.file_delete_student("A01059334")
 def test_add_student_full(self, mock_input):
     student_clone = student.Student('Kyla', 'Purcell', 'A01088856', True,
                                     [80])
     self.assertEqual(student_clone.__repr__(),
                      crud.add_student().__repr__())
 def test_add_student_empty_grades(self, mock_input):
     student_clone = student.Student('Kyla', 'Purcell', 'A01088856', True,
                                     [])
     self.assertEqual(student_clone.get_grades_list(),
                      crud.add_student().get_grades_list())
 def test_add_student_invalid_last_name(self, mock_input):
     self.assertIsNone(crud.add_student())
 def test_add_student_student_number(self, mock_input):
     student_clone = student.Student('Kyla', 'Purcell', 'A01088856', True,
                                     [80])
     self.assertEqual(student_clone.get_student_number(),
                      crud.add_student().get_student_number())