diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2014-12-18 15:53:18 -0500 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2014-12-18 15:53:18 -0500 |
commit | 6c3ec50a43692aeac1776e6247f2668fa24da501 (patch) | |
tree | bbc7d0ff9407f6d9e1e38c416edf9d5ee49c7526 /test | |
parent | cf1b6517343189451bbfd64564e0fa3b2f346023 (diff) | |
download | openshift-6c3ec50a43692aeac1776e6247f2668fa24da501.tar.gz openshift-6c3ec50a43692aeac1776e6247f2668fa24da501.tar.bz2 openshift-6c3ec50a43692aeac1776e6247f2668fa24da501.tar.xz openshift-6c3ec50a43692aeac1776e6247f2668fa24da501.zip |
Updated with more tests
Diffstat (limited to 'test')
-rwxr-xr-x | test/units/mutli_ec2_test.py | 28 |
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 |