Ansible - Unit test fix on diffing (#198)

<!-- This change is generated by MagicModules. -->
/cc @rambleraptor
This commit is contained in:
The Magician 2019-02-27 14:38:46 -08:00 committed by Alex Stephen
parent e2095ffa01
commit 675efbaadd
2 changed files with 9 additions and 6 deletions

View file

@ -284,9 +284,15 @@ class GcpRequest(object):
list2.sort()
for index in range(len(list1)):
value1 = list1[index]
if index < len(list2):
value2 = list2[index]
difference.append(self._compare_value(value1, value2))
# If items are dicts or arrays, we're assuming the next value
# is the correct one.
if isinstance(value1, dict) or isinstance(value1, list):
if index < len(list2):
value2 = list2[index]
difference.append(self._compare_value(value1, value2))
else:
if value1 not in list2:
difference.append(value1)
difference2 = []
for value in difference:

View file

@ -149,9 +149,6 @@ class GCPRequestDifferenceTestCase(unittest.TestCase):
'test': 'value',
'foo': 'bar'
},
{
'different': 'dict'
}
]
}
value2 = {