summaryrefslogtreecommitdiff
path: root/tests/unittests/test_merging.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2013-05-09 22:34:31 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2013-05-09 22:34:31 -0700
commit2b351c5435939d16ba06ec0c45847d47f4b21d51 (patch)
tree15fb06e783875ff481fd3c148311eecde453bebb /tests/unittests/test_merging.py
parentff232886555964220769da6d8b73198b5d51ef16 (diff)
downloadvyos-cloud-init-2b351c5435939d16ba06ec0c45847d47f4b21d51.tar.gz
vyos-cloud-init-2b351c5435939d16ba06ec0c45847d47f4b21d51.zip
Fix the cloud config merging so that it is backwards compat.
The new change for merging works well in the mergedict case but the default merging type for cloud config needs to reflect how yaml was loaded in bulk, which is the same as the replacing keys merging type that is now provided.
Diffstat (limited to 'tests/unittests/test_merging.py')
-rw-r--r--tests/unittests/test_merging.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unittests/test_merging.py b/tests/unittests/test_merging.py
index dddf8c6c..ba1c67d7 100644
--- a/tests/unittests/test_merging.py
+++ b/tests/unittests/test_merging.py
@@ -167,6 +167,21 @@ class TestSimpleRun(helpers.ResourceUsingTestCase):
d = util.mergemanydict([a, b])
self.assertEquals(c, d)
+ def test_compat_merges_dict(self):
+ a = {
+ 'Blah': 1,
+ 'Blah2': 2,
+ 'Blah3': 3,
+ }
+ b = {
+ 'Blah': 1,
+ 'Blah2': 2,
+ 'Blah3': [1],
+ }
+ c = _old_mergedict(a, b)
+ d = util.mergemanydict([a, b])
+ self.assertEquals(c, d)
+
def test_compat_merges_list(self):
a = {'b': [1, 2, 3]}
b = {'b': [4, 5]}