summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2011-07-23 16:57:04 +0900
committerIsaku Yamahata <yamahata@valinux.co.jp>2011-07-23 16:57:04 +0900
commit4c1fd45270faef4b42504bb5e2b8bd3e49b14d8c (patch)
treef45cc968dcd6fb430c957fd38c19e1f5a0c81e8a
parent77c34f0223a21d122062b2057e9ed1584dbbf8bf (diff)
tests/test_cloud:test_modify_image: make it pass
-rw-r--r--nova/tests/test_cloud.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py
index 8cdc73a66..0f1dfb813 100644
--- a/nova/tests/test_cloud.py
+++ b/nova/tests/test_cloud.py
@@ -852,13 +852,16 @@ class CloudTestCase(test.TestCase):
def test_modify_image_attribute(self):
modify_image_attribute = self.cloud.modify_image_attribute
+ fake_metadata = {'id': 1, 'container_format': 'ami',
+ 'properties': {'kernel_id': 1, 'ramdisk_id': 1,
+ 'type': 'machine'}, 'is_public': False}
+
def fake_show(meh, context, id):
- return {'id': 1, 'container_format': 'ami',
- 'properties': {'kernel_id': 1, 'ramdisk_id': 1,
- 'type': 'machine'}, 'is_public': False}
+ return fake_metadata
def fake_update(meh, context, image_id, metadata, data=None):
- return metadata
+ fake_metadata.update(metadata)
+ return fake_metadata
self.stubs.Set(fake._FakeImageService, 'show', fake_show)
self.stubs.Set(fake._FakeImageService, 'show_by_name', fake_show)