def test_object_not_created_error_last_name(self): with self.assertRaises(ValueError): stu = s.Student("Ch1rst3ns3n", "Moragan", "Cybersecurity", 3.8)
def test_object_not_created_error_first_name(self): with self.assertRaises(ValueError): stu = t.Student("Alvarado", "Alex1234", "English", 4.0)
def test_object_not_created_error_gpa(self): with self.assertRaises(ValueError): stu = t.Student("Jackson", "Percy", "CompSci", 4.5)
def test_object_not_created_error_gpa(self): with self.assertRaises(ValueError): s = Students.Students('Lehmann', 'Ben', 'Math', 3.8)
def test_object_created_all_attributes(self): student = t.Student("McDonald", "Ronald", "Chem", 4.0) assert student.last_name == "McDonald" assert student.first_name == "Ronald" assert student.major == "Chem" assert student.gpa ==4.0
def setUp(self): self.student = t.Student('Shannon', 'Aidan', 'English')
def test_object_not_created_error_first_name(self): with self.assertRaises(ValueError): s = Students.Students('123', 'Lehmann', 'Math', 3.0)
def test_object_not_created_error_major(self): with self.assertRaises(ValueError): stu = t.Student('Trenary', 'Brady', 'CompSkci', 4.0)
def test_object_not_created_error_gpa_not_float(self): with self.assertRaises(ValueError): stu = t.Student('Trenary', 'Brady', 'CompSci', 'A')
def test_object_created_all_attributes(self): student = t.Student('Trenary', 'Brady', 'CompSci', 4.0) assert student.last_name == 'Trenary' assert student.first_name == 'Brady' assert student.major == 'CompSci' assert student.gpa == 4.0
def test_object_not_created_error_first_name(self): with self.assertRaises(ValueError): stu = t.Student('Trenary', 'Br1865ady', 'CompSci', 4.0)
def setUp(self): self.student1 = s.Student('Doe', 'John', 'Criminal Justice') self.student2 = s.Student('Doe', 'John', 'Criminal Justice', 3.7)
def test_object_not_created_error_gpa(self): with self.assertRaises(ValueError): stu = s.Student("Chirstensen", "M0rg8n", "Cybersecurity", 3.8)
def test_object_not_created_error_major(self): with self.assertRaises(ValueError): stu = s.Student("Chirstensen", "M0rg8n", "World Domination", 3.8)
def test_object_not_created_error_major(self): with self.assertRaises(ValueError): stu = t.Student("Potter", "Harry", "Spell", 4.0)
def setUp(self): self.student = t.Student('Trenary', 'Brady', 'CompSci', 4.0)
def test_object_not_created_error_gpa_not_float(self): with self.assertRaises(ValueError): stu = t.Student("Potter", "Harry", "Necromancy", 'A')
def test_object_not_created_error_fist_name(self): with self.assertRaises(ValueError): s = t.Student('Johnson', '123', 'Computers')
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
def test_object_not_created_error_major(self): with self.assertRaises(ValueError): s = t.Student('Johnson', 'Mark', '123')
def test_object_not_created_error_major(self): with self.assertRaises(ValueError): s = Students.Students('Lehmann', 'Ben', '123', 3.0)
def test_object_not_created_error_gpa(self): with self.assertRaises(ValueError): s = t.Student('Johnson', 'Mark', 'Computers', 'Three')
def setUp(self): self.student = Students.Students('Lehmann', 'Ben', 'Math', gpa=3.0)
def setUp(self): self.student1 = t.Student('Johnson', 'Mark', 'Computers', 3.5) self.student2 = t.Student('Richards', 'Simon', 'Computers')
def test_object_not_created_error_last_name(self): with self.assertRaises(ValueError): stu = t.Student("1234sfd", "Alex", "English", 4.0)
def test_object_created_all_attributes(self): student = t.Student("Shannon", "Aidan", "CompSci", 4.0) assert student.last_name == "Shannon" assert student.first_name == "Aidan" assert student.major == "CompSci" assert student.gpa == 4.0
def test_object_not_created_error_major(self): with self.assertRaises(ValueError): stu = t.Student("Jackson", "Percy", "Spell", 4.0)
def test_object_not_created_error_first_name(self): with self.assertRaises(ValueError): stu = t.Student("Shannon", "1234asfas", "English", 4.0)
def setUp(self): self.student = t.Student('Alvarado', 'Alex', 'English', 4.0)
def test_object_not_created_error_gpa(self): with self.assertRaises(ValueError): test = std.Student('Bob', 'Billy', 'Billy bobbing', 'abcd') test = std.Student('Bob', 'Billy', 'Billy bobbing', 5.0) test = std.Student('Bob', 'Billy', 'Billy bobbing', -1)