예제 #1
0
 def setUp(self):
     self.student = Students.Students('Lehmann', 'Ben', 'Math', gpa=3.0)
예제 #2
0
 def test_object_not_created_error_gpa(self):
     with self.assertRaises(ValueError):
         s = Students.Students('Lehmann', 'Ben', 'Math', 3.8)
예제 #3
0
 def test_object_not_created_error_first_name(self):
     with self.assertRaises(ValueError):
         s = Students.Students('123', 'Lehmann', 'Math', 3.0)
예제 #4
0
 def test_object_not_created_error_major(self):
     with self.assertRaises(ValueError):
         s = Students.Students('Lehmann', 'Ben', '123', 3.0)
예제 #5
0
 def test_object_created_all_attributes(self):
     student = Students.Students('Lehmann', 'Ben', 'Math', gpa=3.0)
     assert student.last_name == 'Lehmann'
     assert student.first_name == 'Ben'
     assert student.major == 'Math'
     assert student.gpa == 3.0