Пример #1
0
 def test_alert(self):
     self.assertEqual(hw4.alert(self.disney_class), {'Donald', 'Pluto'})
     orginal_disney = {'Mickey': [78, 50, 100], 'Minnie': [88, 65, 99, 70],
                      'Pluto': [70, 49, 87, 66, 38], 'Donald': [40]}
     self.assertEqual((self.disney_class), orginal_disney)
     self.assertEqual(hw4.alert(self.cs122), set())
     original_cs122 = {'Alex': [76, 90], 'Diana': [100, 100, 100],
                       'Zoe': [50, 87, 90, 100]}
     self.assertEqual(self.cs122, original_cs122)
Пример #2
0
 def test_alert_default(self):
     """Test alert with default values"""
     self.assertEqual(hw4.alert(self.disney_class), {'Donald', 'Pluto'})
     self.assertEqual(
         self.disney_class, {
             'Mickey': [78, 50, 100],
             'Minnie': [88, 65, 99, 70],
             'Pluto': [70, 49, 87, 66, 38],
             'Donald': [40]
         })
     self.assertEqual(hw4.alert(self.cs122), set())
     self.assertEqual(self.cs122, {
         'Alex': [76, 90],
         'Diana': [100, 100, 100],
         'Zoe': [50, 87, 90, 100]
     })
Пример #3
0
 def test_alert_122(self):
     """Checks to see if running a class with no low grades, but has
     elements through the alert class will modify the original"""
     self.assertEqual(hw4.alert(self.cs122), set())
     self.assertEqual(self.cs122, {
         'Alex': [76, 90],
         'Diana': [100, 100, 100],
         'Zoe': [50, 87, 90, 100]
     })
Пример #4
0
 def test_alert_unchanged(self):
     """Tests the alert function to make sure it doesn't modify
     dictionary"""
     self.assertEqual(hw4.alert(self.disney_class), {'Donald', 'Pluto'})
     self.assertEqual(
         self.disney_class, {
             'Mickey': [78, 50, 100],
             'Minnie': [88, 65, 99, 70],
             'Pluto': [70, 49, 87, 66, 38],
             'Donald': [40]
         })
Пример #5
0
 def test_alert_empty_unchanged(self):
     """Tests the alert function with an empty set and then
     checks to see the original empty wasn't modified"""
     self.assertEqual(hw4.alert(self.empty_class), set())
     self.assertEqual(self.empty_class, {})
Пример #6
0
 def test_alert_empty_set(self):
     """Tests the alert function with an empty set"""
     self.assertEqual(hw4.alert(self.empty_class), set())
Пример #7
0
 def test_alert_no_issues(self):
     """Tests the alert function with a set that's okay"""
     self.assertEqual(hw4.alert(self.cs122), set())
Пример #8
0
 def test_alert_low_grades(self):
     """Tests the alert function for low grades"""
     self.assertEqual(hw4.alert(self.disney_class), {'Donald', 'Pluto'})
Пример #9
0
 def test_alert_empty(self):
     self.assertEqual(hw4.alert(self.empty_class),set())
     # test if the dictionary unchanged
     self.assertEqual(self.empty_class, {});
Пример #10
0
 def test_alert_empty(self):
     """Test alert with empty class"""
     self.assertEqual(hw4.alert(self.empty_class), set())
     self.assertEqual(self.empty_class, {})
Пример #11
0
 def test_alert(self):
     """Test alert with arbitrary dictionaries"""
     self.assertEqual(hw4.alert(self.disney_class), {'Donald', 'Pluto'})
     self.assertEqual(self.disney_class, self.orginal_disney)
     self.assertEqual(hw4.alert(self.cs122), set())
     self.assertEqual(self.cs122, self.original_cs122)