mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-09 12:20:27 -07:00
Ansible - Unit test fix on diffing (#198)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
e2095ffa01
commit
675efbaadd
2 changed files with 9 additions and 6 deletions
|
@ -284,9 +284,15 @@ class GcpRequest(object):
|
||||||
list2.sort()
|
list2.sort()
|
||||||
for index in range(len(list1)):
|
for index in range(len(list1)):
|
||||||
value1 = list1[index]
|
value1 = list1[index]
|
||||||
if index < len(list2):
|
# If items are dicts or arrays, we're assuming the next value
|
||||||
value2 = list2[index]
|
# is the correct one.
|
||||||
difference.append(self._compare_value(value1, value2))
|
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 = []
|
difference2 = []
|
||||||
for value in difference:
|
for value in difference:
|
||||||
|
|
|
@ -149,9 +149,6 @@ class GCPRequestDifferenceTestCase(unittest.TestCase):
|
||||||
'test': 'value',
|
'test': 'value',
|
||||||
'foo': 'bar'
|
'foo': 'bar'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'different': 'dict'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
value2 = {
|
value2 = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue