예제 #1
0
 def setUp(self):
     self.student = t.Student('Kelso', 'Alex', 'English', 4.0)
예제 #2
0
 def test_object_not_created_error_first_name(self):
     with self.assertRaises(ValueError):
         stud = t.Student('1234asfas', 'Alex', 'English', 4.0)
예제 #3
0
 def test_object_not_created_error_gps(self):
     with self.assertRaises(ValueError):
         stud = t.Student('Potter', 'Harry', 'Spell', 4.5)
예제 #4
0
 def test_student_str(self):
     student = t.Student('Michael', 'Alex', 'CompSci', 4.0)
     assert student.last_name == 'Michael'
     assert student.first_name == 'Alex'
     assert student.major == 'CompSci'
     assert student.gpa == 4.0