Fix py33 due to readonly and metadata patches

A couple recent merges broke py33 - this fixes it.

Change-Id: Iaab8a08aeb42c954f3ecff7da70003d1c4eead0d
This commit is contained in:
Avishay Traeger
2013-10-30 10:20:17 +02:00
parent e5ae2ff8d7
commit bdd560b3c0
4 changed files with 10 additions and 10 deletions

View File

@@ -346,7 +346,7 @@ class FakeHTTPClient(base_client.HTTPClient):
assert 'host' in body[action]
assert 'force_host_copy' in body[action]
elif action == 'os-update_readonly_flag':
assert body[action].keys() == ['readonly']
assert list(body[action]) == ['readonly']
else:
raise AssertionError("Unexpected action: %s" % action)
return (resp, {}, _body)

View File

@@ -286,13 +286,13 @@ class ShellTest(utils.TestCase):
def test_snapshot_metadata_unset_dict(self):
self.run_command('snapshot-metadata 1234 unset key1=val1 key2=val2')
self.assert_called('DELETE', '/snapshots/1234/metadata/key1')
self.assert_called('DELETE', '/snapshots/1234/metadata/key2', pos=-2)
self.assert_called_anytime('DELETE', '/snapshots/1234/metadata/key1')
self.assert_called_anytime('DELETE', '/snapshots/1234/metadata/key2')
def test_snapshot_metadata_unset_keys(self):
self.run_command('snapshot-metadata 1234 unset key1 key2')
self.assert_called('DELETE', '/snapshots/1234/metadata/key1')
self.assert_called('DELETE', '/snapshots/1234/metadata/key2', pos=-2)
self.assert_called_anytime('DELETE', '/snapshots/1234/metadata/key1')
self.assert_called_anytime('DELETE', '/snapshots/1234/metadata/key2')
def test_volume_metadata_update_all(self):
self.run_command('metadata-update-all 1234 key1=val1 key2=val2')

View File

@@ -353,7 +353,7 @@ class FakeHTTPClient(base_client.HTTPClient):
assert 'host' in body[action]
assert 'force_host_copy' in body[action]
elif action == 'os-update_readonly_flag':
assert body[action].keys() == ['readonly']
assert list(body[action]) == ['readonly']
else:
raise AssertionError("Unexpected action: %s" % action)
return (resp, {}, _body)

View File

@@ -264,13 +264,13 @@ class ShellTest(utils.TestCase):
def test_snapshot_metadata_unset_dict(self):
self.run_command('snapshot-metadata 1234 unset key1=val1 key2=val2')
self.assert_called('DELETE', '/snapshots/1234/metadata/key1')
self.assert_called('DELETE', '/snapshots/1234/metadata/key2', pos=-2)
self.assert_called_anytime('DELETE', '/snapshots/1234/metadata/key1')
self.assert_called_anytime('DELETE', '/snapshots/1234/metadata/key2')
def test_snapshot_metadata_unset_keys(self):
self.run_command('snapshot-metadata 1234 unset key1 key2')
self.assert_called('DELETE', '/snapshots/1234/metadata/key1')
self.assert_called('DELETE', '/snapshots/1234/metadata/key2', pos=-2)
self.assert_called_anytime('DELETE', '/snapshots/1234/metadata/key1')
self.assert_called_anytime('DELETE', '/snapshots/1234/metadata/key2')
def test_volume_metadata_update_all(self):
self.run_command('metadata-update-all 1234 key1=val1 key2=val2')