예제 #1
0
 def test_keys_may_be_added_previous_state_specified_by_none(self):
     change = [{'from': {'new_key': None}, 'to': {'new_key': 'qweert'}}]
     tags = apply_changes({'key': 'value'}, change)
     self.assertEqual({'key': 'value', 'new_key': 'qweert'}, tags)
예제 #2
0
 def test_for_apply_changes_function_presence(self):
     tags = {}
     change = {}
     apply_changes(tags, change)
예제 #3
0
 def test_keys_may_be_added_to_empty_object(self):
     change = [{'from': {}, 'to': {'new_key': 'qweert'}}]
     tags = apply_changes({}, change)
     self.assertEqual({'new_key': 'qweert'}, tags)
예제 #4
0
 def test_keys_may_be_added(self):
     change = [{'from': {}, 'to': {'new_key': 'qweert'}}]
     tags = apply_changes({'key': 'value'}, change)
     self.assertEqual({'key': 'value', 'new_key': 'qweert'}, tags)
예제 #5
0
 def test_from_values_are_deleted_on_specifying_none(self):
     change = [{'from': {'key': 'value'}, 'to': {'key': None}}]
     tags = apply_changes({'key': 'value'}, change)
     self.assertEqual({}, tags)
예제 #6
0
 def test_from_values_are_deleted(self):
     change = [{'from': {'key': 'value'}, 'to': {}}]
     tags = apply_changes({'key': 'value'}, change)
     self.assertEqual({}, tags)
예제 #7
0
 def test_simplest_applying_changes(self):
     tags = {'wikipedia': 'en:Walmart Market'}
     change = [{'to': {'wikipedia': 'en:Walmart'}, 'from': {'wikipedia': 'en:Walmart Market'}}]
     tags = apply_changes(tags, change)
     self.assertEqual({"wikipedia": "en:Walmart"}, tags)