def test_extra_credit_default(self): """Test extra_credit with default values""" self.assertEqual(hw4.extra_credit(self.cs122), { 'Zoe': 91, 'Alex': 94, 'Dan': 80, 'Anna': 101 }) self.assertEqual(self.cs122, { 'Zoe': 91, 'Alex': 94, 'Dan': 80, 'Anna': 101 }) self.assertEqual(hw4.extra_credit(self.cs122, 2), { 'Zoe': 93, 'Alex': 96, 'Dan': 82, 'Anna': 103 }) self.assertEqual(self.cs122, { 'Zoe': 93, 'Alex': 96, 'Dan': 82, 'Anna': 103 })
def test_extra_credit(self): modified_dict = {'Zoe':91, 'Alex': 94, 'Dan':80, 'Anna':101} self.assertEqual(hw4.extra_credit(self.cs122),modified_dict ) # check if the dictionary changed self.assertEqual(self.cs122, modified_dict) modified_dict = {'Zoe': 93, 'Alex': 96, 'Dan': 82, 'Anna': 103} self.assertEqual(hw4.extra_credit(self.cs122, 2), modified_dict) # check if the dictionary changed self.assertEqual(self.cs122, modified_dict)
def test_extra_credit(self): """Continues to test several test cases for extra_credit().""" self.assertEqual(hw4.extra_credit(self.cs122, 2), { 'Zoe': 92, 'Alex': 95, 'Dan': 81, 'Anna': 102 }) self.assertEqual(hw4.extra_credit(self.empty_class, 5), {})
def test_extra_credit(self): """Test extra_credit with dictionary""" self.assertEqual(hw4.extra_credit(self.cs122), {'Zoe':91, 'Alex': 94, 'Dan':80, 'Anna':101}) # check if the updated dictionary self.assertEqual(self.cs122, {'Zoe':91, 'Alex': 94, 'Dan':80, 'Anna':101}) self.assertEqual(hw4.extra_credit(self.cs122, 2), {'Zoe': 93, 'Alex': 96, 'Dan': 82, 'Anna': 103}) # check if the updated dictionary self.assertEqual(self.cs122, {'Zoe': 93, 'Alex': 96, 'Dan': 82, 'Anna': 103})
def test_extra_credit_org_dict_unmodified(self): """ Test the original dictionaries are unmodified after extra_credit(). """ hw4.extra_credit(self.empty_class, 5) self.assertEqual(self.empty_class, {}) hw4.extra_credit(self.cs122, 2) self.assertEqual(self.cs122, { 'Zoe': 90, 'Alex': 93, 'Dan': 79, 'Anna': 100 })
def test_extra_credit_continuous(self): """Check to see if continuing calling method will cause it ot break""" self.assertEqual(hw4.extra_credit(self.cs122), { 'Zoe': 91, 'Alex': 94, 'Dan': 80, 'Anna': 101 }) self.assertEqual(hw4.extra_credit(self.cs122, 2), { 'Zoe': 93, 'Alex': 96, 'Dan': 82, 'Anna': 103 })
def test_extra_credit_output(self): """Tests adding extra credit with a parameter passed""" self.assertEqual(hw4.extra_credit(self.cs122, 2), { 'Zoe': 92, 'Alex': 95, 'Dan': 81, 'Anna': 102 })
def test_extra_credit_output_default(self): """Tests adding extra credit default""" self.assertEqual(hw4.extra_credit(self.cs122), { 'Zoe': 91, 'Alex': 94, 'Dan': 80, 'Anna': 101 })
def test_extra_credit_default_args(self): """Test if extra_credit() works with default argument.""" self.assertEqual(hw4.extra_credit(self.cs122), { 'Zoe': 91, 'Alex': 94, 'Dan': 80, 'Anna': 101 })
def test_extra_credit_does_modify(self): """Check to see if the function IS modifying the argument""" self.assertEqual(hw4.extra_credit(self.cs122), { 'Zoe': 91, 'Alex': 94, 'Dan': 80, 'Anna': 101 }) self.assertEqual(self.cs122, { 'Zoe': 91, 'Alex': 94, 'Dan': 80, 'Anna': 101 })
def test_extra_credit_2(self): """Test the extra_credit function with point = 2.""" self.assertEqual(hw4.extra_credit(self.cs122, 2), { 'Zoe': 92, 'Alex': 95, 'Dan': 81, 'Anna': 102 }) self.assertEqual(self.cs122, { 'Zoe': 90, 'Alex': 93, 'Dan': 79, 'Anna': 100 })
def test_extra_credit_default(self): """Test the extra_credit function default parameter.""" self.assertEqual(hw4.extra_credit(self.cs122), { 'Zoe': 91, 'Alex': 94, 'Dan': 80, 'Anna': 101 }) self.assertEqual(self.cs122, { 'Zoe': 90, 'Alex': 93, 'Dan': 79, 'Anna': 100 })
def test_extra_credit_empty(self): """Test to see extra credit handling empty dictionary""" self.assertEqual(hw4.extra_credit(self.empty_class), {})
def test_extra_credit_empty(self): """Test the extra_credit function with empty dictionary.""" self.assertEqual(hw4.extra_credit(self.empty_class, 5), {})
def test_extra_credit_empty(self): self.assertEqual(hw4.extra_credit(self.empty_class, 5),{}) self.assertEqual(self.empty_class, {})
def test_extra_credit_empty(self): """Test extra_credit with empty dictionary""" self.assertEqual(hw4.extra_credit(self.empty_class, 5),{}) self.assertEqual(self.empty_class, {})