Beispiel #1
0
 def test_patch_has_no_side_effects(self):
     a = {'a': 1}
     copy_of_a = deepcopy(a)
     b = {'a': 2}
     d = diff(a, b)
     self.assertEqual(patch_mapping(a, d), b)
     self.assertEqual(a, copy_of_a)
Beispiel #2
0
 def test_unchanged_items_make_no_difference(self):
     a = {'a': 'a'}
     b = {'a': 'b'}
     c = {'a': 'a', 'b': 1, 'c': (3, 4)}
     d = diff(a, b)
     self.assertEqual(patch_mapping(c, d), {'a': 'b', 'b': 1, 'c': (3, 4)})