summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wolf <will.wolf@rackspace.com>2011-05-06 14:11:18 -0400
committerWilliam Wolf <will.wolf@rackspace.com>2011-05-06 14:11:18 -0400
commit4a0142bdcd3d15c629ca96ba6d3d7fdaa13ed278 (patch)
tree44ffd489218a9c76859e8199ca508104fd320920
parent900e446a41a930b2585950e711948d6e45f37bdd (diff)
added test for show_by_name ImageNotFound exception
-rw-r--r--nova/tests/api/openstack/test_images.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/test_images.py b/nova/tests/api/openstack/test_images.py
index e5dd93c3f..2c329f920 100644
--- a/nova/tests/api/openstack/test_images.py
+++ b/nova/tests/api/openstack/test_images.py
@@ -75,6 +75,18 @@ class _BaseImageServiceTests(test.TestCase):
self.context,
'bad image id')
+ def test_create_and_show_non_existing_image_by_name(self):
+ fixture = self._make_fixture('test image')
+ num_images = len(self.service.index(self.context))
+
+ image_id = self.service.create(self.context, fixture)['id']
+
+ self.assertNotEquals(None, image_id)
+ self.assertRaises(exception.ImageNotFound,
+ self.service.show_by_name,
+ self.context,
+ 'bad image id')
+
def test_update(self):
fixture = self._make_fixture('test image')
image_id = self.service.create(self.context, fixture)['id']