python3: sort dict for post_volumes_1234_action test
In Python 3, hash randomization is enabled by default. It causes the iteration order of dicts and sets to be unpredictable and differ across Python runs. Sort the list and update the expecting result. Change-Id: Iead7ca8f45b035abd78f0b25865b5f7e1b9f3294 Signed-off-by: Chuck Short <chuck.short@canonical.com>
This commit is contained in:
@@ -316,7 +316,8 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
assert len(list(body)) == 1
|
||||
action = list(body)[0]
|
||||
if action == 'os-attach':
|
||||
assert list(body[action]) == ['instance_uuid', 'mountpoint']
|
||||
assert sorted(list(body[action])) == ['instance_uuid',
|
||||
'mountpoint']
|
||||
elif action == 'os-detach':
|
||||
assert body[action] is None
|
||||
elif action == 'os-reserve':
|
||||
|
||||
@@ -323,7 +323,8 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
assert len(list(body)) == 1
|
||||
action = list(body)[0]
|
||||
if action == 'os-attach':
|
||||
assert list(body[action]) == ['instance_uuid', 'mountpoint']
|
||||
assert sorted(list(body[action])) == ['instance_uuid',
|
||||
'mountpoint']
|
||||
elif action == 'os-detach':
|
||||
assert body[action] is None
|
||||
elif action == 'os-reserve':
|
||||
|
||||
Reference in New Issue
Block a user