def test_object_not_created_error_gpa(self): with self.assertRaises(ValueError): student = s.Student("Wang", "Shiqi", "Computer Science", 3) with self.assertRaises(ValueError): student = s.Student("Wang", "Shiqi", "Computer Science", "abc") with self.assertRaises(ValueError): student = s.Student("Wang", "Shiqi", "Computer Science", 5.0)
def test_object_not_created_error_gpa(self): with self.assertRaises(TypeError): student = s.Student("Dorna", "Jim", "Comp Sci", "3.50") with self.assertRaises(ValueError): student = s.Student("Dorna", "Jim", "Comp Sci", 4.01) student = s.Student("Dorna", "Jim", "Comp Sci", 400) student = s.Student("Dorna", "Jim", "Comp Sci", -.01)
def test_object_not_created_error_last_name(self): with self.assertRaises(TypeError): student = s.Student("Jim", "Comp Sci") student = s.Student("Jim", "Comp Sci", 3.50) with self.assertRaises(ValueError): student = s.Student("Jim", "Comp Sci", "3.50") student = s.Student("3.50", "Jim", "Comp Sci") student = s.Student(3.50, "Jim", "Comp Sci")
def test_student_class_display_name_ssn(self): p = t.Student('Manning', 'Peyton', 'computer information science', 2.5) # Does not use person from setUp(), has local p self.assertEqual( str(p), "Manning, Peyton has major computer information science with gpa: 2.5" )
def test_object_created_all_attributes(self): student = t.Student( 'Duck', 'Daisy', '111-11-1111') # this is not self.person from setUp, but local assert student.last_name == 'Duck' # note no self here on person or assert assert student.first_name == 'Daisy' assert student.major == 'Math'
def test_inital_all_attributes(self): student = t.Student( 'Manning', 'Peyton', 'computer information science', 2.5) # this is not self.person from setUp, but local assert student.last_name == 'Manning' # note no self here on person or assert assert student.first_name == 'Peyton' assert student.major == 'computer information science' assert student.gpa == 2.5
def test_object_created_all_attributes(self): student = s.Student( 'Smith', 'Johnny', 'Culinary', 3.25) # this is not self.person from setUp, but local assert student.last_name == 'Smith' # note no self here on person or assert assert student.first_name == 'Johnny' assert student.major == 'Culinary' assert student.gpa == 3.25
def test_object_created_all_attributes(self): student = s.Student( 'Meeker', 'Daniel', 'BIS-OOP', 3.9) # this is not self.person from setUp, but local assert student.last_name == 'Meeker' # note no self here on person or assert assert student.first_name == 'Daniel' assert student.major == 'BIS-OOP' assert student.gpa == 3.9
def test_object_created_all_attributes(self): #test constructor values set to all attributes for acceptable values student = s.Student( 'Chan', 'Jackie', 'Biology', 3.9) #this is not self.student from setUp, but local assert student.last_name == 'Chan' #no self assert student.first_name == 'Jackie' assert student.major == 'Biology' assert student.gpa == 3.9
def setUp(self): self.student = s.Student('Janeway', 'Kathryn', 'CIS', 4.0)
def setUp(self): self.student = s.Student("Dorna", "Jim", "Comp Sci")
def test_object_not_created_error_major(self): with self.assertRaises(TypeError): student = s.Student("Dorna", "Jim") student = s.Student("Dorna", "Jim", 3.50) with self.assertRaises(ValueError): student = s.Student("Dorna", "Jim", "3.50")
def test_student_str(self): student = s.Student("Dorna", "Jim", "Comp Sci", 3.50) assert str(student) == "Dorna, Jim has major Comp Sci with gpa: 3.5"
def test_object_not_created_error_in_gpa(self): with self.assertRaises(ValueError): p = s.Student('Janeway', 'Kathryn', 'CIS', 5.0) d = s.Student('Janeway', 'Kathryn', 'CIS', 2) q = s.Student('Janeway', 'Kathryn', 'CIS', 'Four Point O')
def test_object_created_all_attributes(self): student = s.Student("Dorna", "Jim", "Comp Sci", 3.50) assert student.last_name == "Dorna" assert student.first_name == "Jim" assert student.major == "Comp Sci" assert student.gpa == 3.50
def test_object_not_created_error_last_name(self): with self.assertRaises(ValueError): l_student = s.Student('123', 'Michael', 'CIS')
def test_object_not_created_error_in_major(self): with self.assertRaises(ValueError): p = s.Student('Janeway', 'Kathryn', 'Reading')
def test_object_not_created_error_first_name(self): with self.assertRaises(ValueError): s = t.Student('Sears', '809', 'CIS')
def test_object_not_created_error_gpa(self): with self.assertRaises(ValueError): s = t.Student('Sears', 'Ricky', 'CIS', 'threepointfourfive')
def test_object_created_all_attributes(self): student = t.Student("Sears", "Ricky", "CIS", 3.48) assert student.last_name == "Sears" assert student.first_name == "Ricky" assert student.major == "CIS" assert student.gpa == 3.48
def setUp(self): self.t_student = s.Student('Day', 'Michael', 'CIS')
def test_object_not_created_error_gpa(self): with self.assertRaises(ValueError): l_student = s.Student('Day', 'Michael', 'CIS', 'cat') with self.assertRaises(ValueError): l_student = s.Student('Day', 'Michael', 'CIS', 999)
def test_object_not_created_error_major(self): with self.assertRaises(ValueError): l_student = s.Student('Day', 'Michael', '123')
def test_object_not_created_error_first_name(self): with self.assertRaises(ValueError): l_student = s.Student('Day', '123', 'CIS')
def test_object_not_created_error_last_name(self): with self.assertRaises(ValueError): s = t.Student('5', 'Ricky', 'CIS')
def test_object_created_all_attributes(self): student = s.Student('Janeway', 'Kathryn', 'CIS', 4.0) assert student.last_name == 'Janeway' assert student.first_name == 'Kathryn' assert student.major == 'CIS' assert student.gpa == 4.0
def test_object_not_created_error_major(self): with self.assertRaises(ValueError): s = t.Student('Sears', 'Ricky', '515')
def test_object_not_created_error_last_name(self): with self.assertRaises(ValueError): p = s.Student('333', 'Kathryn', 'CIS')
def setUp(self): self.student = t.Student('Sears', 'Ricky', 'CIS', 3.48)
def test_object_not_created_error_fist_name(self): with self.assertRaises(ValueError): p = s.Student('Janeway', '333', 'CIS')