Пример #1
0
 def test_object_not_created_error_last_name(self):
     with self.assertRaises(ValueError):
         stu = s.Student("Ch1rst3ns3n", "Moragan", "Cybersecurity", 3.8)
Пример #2
0
 def test_object_not_created_error_first_name(self):
     with self.assertRaises(ValueError):
         stu = t.Student("Alvarado", "Alex1234", "English", 4.0)
Пример #3
0
 def test_object_not_created_error_gpa(self):
     with self.assertRaises(ValueError):
         stu = t.Student("Jackson", "Percy", "CompSci", 4.5)
Пример #4
0
 def test_object_not_created_error_gpa(self):
     with self.assertRaises(ValueError):
         s = Students.Students('Lehmann', 'Ben', 'Math', 3.8)
Пример #5
0
 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
Пример #6
0
 def setUp(self):
     self.student = t.Student('Shannon', 'Aidan', 'English')
Пример #7
0
 def test_object_not_created_error_first_name(self):
     with self.assertRaises(ValueError):
         s = Students.Students('123', 'Lehmann', 'Math', 3.0)
Пример #8
0
 def test_object_not_created_error_major(self):
     with self.assertRaises(ValueError):
         stu = t.Student('Trenary', 'Brady', 'CompSkci', 4.0)
Пример #9
0
 def test_object_not_created_error_gpa_not_float(self):
     with self.assertRaises(ValueError):
         stu = t.Student('Trenary', 'Brady', 'CompSci', 'A')
Пример #10
0
 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
Пример #11
0
 def test_object_not_created_error_first_name(self):
     with self.assertRaises(ValueError):
         stu = t.Student('Trenary', 'Br1865ady', 'CompSci', 4.0)
Пример #12
0
 def setUp(self):
     self.student1 = s.Student('Doe', 'John', 'Criminal Justice')
     self.student2 = s.Student('Doe', 'John', 'Criminal Justice', 3.7)
Пример #13
0
 def test_object_not_created_error_gpa(self):
     with self.assertRaises(ValueError):
         stu = s.Student("Chirstensen", "M0rg8n", "Cybersecurity", 3.8)
Пример #14
0
 def test_object_not_created_error_major(self):
     with self.assertRaises(ValueError):
         stu = s.Student("Chirstensen", "M0rg8n", "World Domination", 3.8)
Пример #15
0
 def test_object_not_created_error_major(self):
     with self.assertRaises(ValueError):
         stu = t.Student("Potter", "Harry", "Spell", 4.0)
Пример #16
0
 def setUp(self):
     self.student = t.Student('Trenary', 'Brady', 'CompSci', 4.0)
Пример #17
0
 def test_object_not_created_error_gpa_not_float(self):
     with self.assertRaises(ValueError):
         stu = t.Student("Potter", "Harry", "Necromancy", 'A')
Пример #18
0
 def test_object_not_created_error_fist_name(self):
     with self.assertRaises(ValueError):
         s = t.Student('Johnson', '123', 'Computers')
Пример #19
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
Пример #20
0
 def test_object_not_created_error_major(self):
     with self.assertRaises(ValueError):
         s = t.Student('Johnson', 'Mark', '123')
Пример #21
0
 def test_object_not_created_error_major(self):
     with self.assertRaises(ValueError):
         s = Students.Students('Lehmann', 'Ben', '123', 3.0)
Пример #22
0
 def test_object_not_created_error_gpa(self):
     with self.assertRaises(ValueError):
         s = t.Student('Johnson', 'Mark', 'Computers', 'Three')
Пример #23
0
 def setUp(self):
     self.student = Students.Students('Lehmann', 'Ben', 'Math', gpa=3.0)
Пример #24
0
 def setUp(self):
     self.student1 = t.Student('Johnson', 'Mark', 'Computers', 3.5)
     self.student2 = t.Student('Richards', 'Simon', 'Computers')
Пример #25
0
 def test_object_not_created_error_last_name(self):
     with self.assertRaises(ValueError):
         stu = t.Student("1234sfd", "Alex", "English", 4.0)
Пример #26
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
Пример #27
0
 def test_object_not_created_error_major(self):
     with self.assertRaises(ValueError):
         stu = t.Student("Jackson", "Percy", "Spell", 4.0)
Пример #28
0
 def test_object_not_created_error_first_name(self):
     with self.assertRaises(ValueError):
         stu = t.Student("Shannon", "1234asfas", "English", 4.0)
Пример #29
0
 def setUp(self):
     self.student = t.Student('Alvarado', 'Alex', 'English', 4.0)
Пример #30
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)