summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2014-12-18 16:02:23 -0500
committerKenny Woodson <kwoodson@redhat.com>2014-12-18 16:02:23 -0500
commite555eeae216e3f9c4061ffc3397bba8d59620615 (patch)
tree238f4229039149392acd99590bd51d2b6d0bca54
parent621dec2791c9a5ae992ac2a175f895e466196712 (diff)
parent176065b2e6cf1cc065846d6cf17832df0e024b89 (diff)
downloadopenshift-e555eeae216e3f9c4061ffc3397bba8d59620615.tar.gz
openshift-e555eeae216e3f9c4061ffc3397bba8d59620615.tar.bz2
openshift-e555eeae216e3f9c4061ffc3397bba8d59620615.tar.xz
openshift-e555eeae216e3f9c4061ffc3397bba8d59620615.zip
Merge pull request #44 from kwoodson/add_multi_tests
Add multi tests
-rwxr-xr-xtest/units/mutli_ec2_test.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/units/mutli_ec2_test.py b/test/units/mutli_ec2_test.py
index 4e6fe61c5..ab76629b1 100755
--- a/test/units/mutli_ec2_test.py
+++ b/test/units/mutli_ec2_test.py
@@ -60,6 +60,34 @@ class MultiEc2Test(unittest.TestCase):
[multi_ec2.MultiEc2.merge_destructively(result, x) for x in [a,b]]
self.assertEqual(result, {"a": {"b": {"c": [1,2]}}})
+ def test_merge_recursive_array_item(self):
+ a = {"a" : {"b": {"c": [1]}}}
+ b = {"a" : {"b": {"c": 2}}}
+ result = {}
+ [multi_ec2.MultiEc2.merge_destructively(result, x) for x in [a,b]]
+ self.assertEqual(result, {"a": {"b": {"c": [1,2]}}})
+
+ def test_merge_recursive_hash_item(self):
+ a = {"a" : {"b": {"c": {"d": 1}}}}
+ b = {"a" : {"b": {"c": 2}}}
+ result = {}
+ [multi_ec2.MultiEc2.merge_destructively(result, x) for x in [a,b]]
+ self.assertEqual(result, {"a": {"b": {"c": [{"d": 1}, 2]}}})
+
+ def test_merge_recursive_array_hash(self):
+ a = {"a" : [{"b": {"c": 1}}]}
+ b = {"a" : {"b": {"c": 1}}}
+ result = {}
+ [multi_ec2.MultiEc2.merge_destructively(result, x) for x in [a,b]]
+ self.assertEqual(result, {"a": [{"b": {"c": 1}}]})
+
+ def test_merge_recursive_hash_array(self):
+ a = {"a" : {"b": {"c": 1}}}
+ b = {"a" : [{"b": {"c": 1}}]}
+ result = {}
+ [multi_ec2.MultiEc2.merge_destructively(result, x) for x in [a,b]]
+ self.assertEqual(result, {"a": [{"b": {"c": 1}}]})
+
def tearDown(self):
pass