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