summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/tests
diff options
context:
space:
mode:
authorSteven Pisarski <s.pisarski@cablelabs.com>2017-07-24 15:11:10 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-24 15:11:10 +0000
commit5bd152987e51ac989575de016a4b8c3eb16c726e (patch)
tree96bf60d735a8822a91ca34099d30bec0a461ed32 /snaps/openstack/tests
parent6c4b4680285ea58219bef80e9bc4a5c056528b31 (diff)
parent8b52c661d1c80828690831cfb8636ec2835fc379 (diff)
Merge "Fixed potential problems with image creation exceptions."
Diffstat (limited to 'snaps/openstack/tests')
-rw-r--r--snaps/openstack/tests/create_image_tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/snaps/openstack/tests/create_image_tests.py b/snaps/openstack/tests/create_image_tests.py
index 6c9b175..5fb39dc 100644
--- a/snaps/openstack/tests/create_image_tests.py
+++ b/snaps/openstack/tests/create_image_tests.py
@@ -524,6 +524,22 @@ class CreateImageNegativeTests(OSIntegrationTestCase):
except Exception as e:
self.fail('Invalid Exception ' + str(e))
+ def test_bad_image_image_type(self):
+ """
+ Expect an ImageCreationError when the image type bad
+ """
+ os_image_settings = openstack_tests.cirros_image_settings(
+ name=self.image_name)
+ self.image_creator = create_image.OpenStackImage(
+ self.os_creds,
+ create_image.ImageSettings(name=os_image_settings.name,
+ image_user=os_image_settings.image_user,
+ img_format='foo',
+ url=os_image_settings.url))
+
+ with self.assertRaises(Exception):
+ self.image_creator.create()
+
def test_bad_image_file(self):
"""
Expect an ImageCreationError when the image file does not exist