Merge "Add one test case to the TestMergeDictUnit for same key dict merge"

This commit is contained in:
Zuul 2018-10-17 00:54:00 +00:00 committed by Gerrit Code Review
commit 6579dd9aaa

View File

@ -44,6 +44,15 @@ class TestMergeDictUnit(unittest.TestCase):
self.assertIn('key2', new.keys())
self.assertIn('key2.1', new['key2'].keys())
def test_merging_nested_dicts_with_same_key(self):
base = {'same_key': {'inside_key1': 'inside_key1'}}
target = {'same_key': {'inside_key2': 'inside_key2'}}
new = du.merge_dict(base, target)
self.assertIn('inside_key1', new['same_key'].keys())
self.assertIn('inside_key2', new['same_key'].keys())
class TestAppendIfUnit(unittest.TestCase):
def test_appending_not_present(self):