From 04812fc03ef301a33d5e2f0fe33787a49cdadc11 Mon Sep 17 00:00:00 2001 From: Sergey Murashov Date: Mon, 10 Feb 2014 17:57:41 +0400 Subject: [PATCH] Add image exception Change-Id: I9836a9d07c7e032783b53b67af5eda070d5e6a38 --- muranodashboard-tests/base.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/muranodashboard-tests/base.py b/muranodashboard-tests/base.py index 8bef5c0..9989fb1 100644 --- a/muranodashboard-tests/base.py +++ b/muranodashboard-tests/base.py @@ -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)