def test_dict_merge(self): test_dict = {} with patch.dict(test_dict, SIMPLE_DICT): self.assertDictEqual(consul_pillar.dict_merge(test_dict, SIMPLE_DICT), SIMPLE_DICT) with patch.dict(test_dict, {'key1': {'key3': {'key4': 'value'}}}): self.assertDictEqual(consul_pillar.dict_merge(test_dict, SIMPLE_DICT), {'key1': {'key2': 'val1', 'key3': {'key4': 'value'}}})
def test_dict_merge(self): test_dict = {} with patch.dict(test_dict, SIMPLE_DICT): self.assertDictEqual( consul_pillar.dict_merge(test_dict, SIMPLE_DICT), SIMPLE_DICT ) with patch.dict(test_dict, {"key1": {"key3": {"key4": "value"}}}): self.assertDictEqual( consul_pillar.dict_merge(test_dict, SIMPLE_DICT), {"key1": {"key2": "val1", "key3": {"key4": "value"}}}, )