mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-07 03:10:30 -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()
|
||||
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:
|
||||
|
|
|
@ -149,9 +149,6 @@ class GCPRequestDifferenceTestCase(unittest.TestCase):
|
|||
'test': 'value',
|
||||
'foo': 'bar'
|
||||
},
|
||||
{
|
||||
'different': 'dict'
|
||||
}
|
||||
]
|
||||
}
|
||||
value2 = {
|
||||
|
|
Loading…
Add table
Reference in a new issue