Add image exception

Change-Id: I9836a9d07c7e032783b53b67af5eda070d5e6a38
This commit is contained in:
Sergey Murashov 2014-02-10 17:57:41 +04:00
parent 304ce81b99
commit 04812fc03e
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)