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:
Chuck Short
2013-10-13 08:36:03 -04:00
parent 0c2839414f
commit 5c462987d2
2 changed files with 4 additions and 2 deletions

View File

@@ -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':

View File

@@ -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':