Merge "Add image exception"

This commit is contained in:
Jenkins 2014-02-17 07:16:54 +00:00 committed by Gerrit Code Review
commit 3e31184047
1 changed files with 12 additions and 0 deletions

View File

@ -23,6 +23,17 @@ from muranoclient.client import Client as mclient
from glanceclient import Client as gclient
class ImageException(Exception):
message = "Image doesn't exist"
def __init__(self, type):
self._error_string = self.message + '\nDetails: %s' \
' image is not found,' % str(type)
def __str__(self):
return self._error_string
class UITestCase(testtools.TestCase):
@classmethod
@ -91,6 +102,7 @@ class UITestCase(testtools.TestCase):
i.properties['murano_image_info'])['type']:
return json.loads(i.properties[
'murano_image_info'])['title']
raise ImageException(type_of_image)
def log_in(self):
self.fill_field(by.By.ID, 'id_username', cfg.common.user)