Example #1
0
 def test_object_created_all_attributes(self):
     this_gpa = 4.0
     this_student = Student(self.LNAME, self.FNAME, self.MAJOR, this_gpa)
     assert this_student.lname == self.LNAME
     assert this_student.fname == self.FNAME
     assert this_student.major == self.MAJOR
     assert this_student.gpa == this_gpa
Example #2
0
 def test_object_not_created_error_gpa_int(self):
     with self.assertRaises(ValueError):
         this_gpa = 2
         this_student = Student(self.LNAME, self.FNAME, self.MAJOR,
                                this_gpa)
Example #3
0
 def test_object_not_created_error_major_name(self):
     with self.assertRaises(ValueError):
         this_major = "123"
         this_student = Student(self.LNAME, self.FNAME, this_major)
Example #4
0
 def test_object_not_created_error_first_name(self):
     with self.assertRaises(ValueError):
         this_fname = "123"
         this_student = Student(self.LNAME, this_fname, self.MAJOR)
Example #5
0
 def setUp(self):
     self.LNAME = "Brown"
     self.FNAME = "Wes"
     self.MAJOR = "CIS"
     self.GPA = 0.0
     self.student = Student(self.LNAME, self.FNAME, self.MAJOR)