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

add one test case to the TestMergeDictUnit for same key dict merge

Change-Id: Ia17de71ac3337acc8cf4ecc9e101c81409e50b44
This commit is contained in:
Weezer Su 2018-09-05 13:12:04 -05:00 committed by weezer su
parent 3200de090d
commit 6716cc5dc2

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):