Skip to content

Commit

Permalink
improve error messages, (more human)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesuspg committed Jun 9, 2016
1 parent e5ab8a6 commit c5ad205
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions fiware-region-sanity-tests/commons/fiware_cloud_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,11 +580,11 @@ def setUpClass(cls):
cls.init_clients(cls.tenant_id, test_flavor, test_image)
cls.init_users()
if not cls.init_world(cls.suite_world, suite=True):
raise Exception("Error in init world")
raise Exception("Error in initialization phase, objects from an older execution can't be deleted")
cls.logger.debug("suite_world = %s", cls.suite_world)
except Exception as ex:
cls.logger.error("Error in setup class: %s", ex.message)
cls.skip_message = "Error in setup class: {0}".format(ex.message)
cls.logger.error("Error in initialization phase: %s", ex.message)
cls.skip_message = "Error in initialization phase: {0}".format(ex.message)

@classmethod
def tearDownClass(cls):
Expand Down
22 changes: 11 additions & 11 deletions fiware-region-sanity-tests/tests/fiware_region_base_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def setUp(self):
super(FiwareRegionsBaseTests, self).setUp()
self.test_world = {}
if not self.init_world(self.test_world):
self.logger.error("Error in init world")
self.skipTest("Error in init world")
self.logger.error("Error in initialization phase")
self.skipTest("Error in initialization phase")
except Exception as ex:
self.logger.error(ex)
self.skipTest(ex)
Expand Down Expand Up @@ -182,44 +182,44 @@ def tearDown(self):
if self.test_world.get('servers'):
self.logger.debug("Tearing down servers...")
if not self.reset_world_servers(self.test_world):
self.fail("Fails tearing down servers in test %s", self._testMethodName)
self.fail("Fails in releasing servers in the %s", self._testMethodName)

if self.test_world.get('sec_groups'):
self.logger.debug("Tearing down security groups...")
if not self.reset_world_sec_groups(self.test_world):
self.fail("Fails tearing down security groups in test %s", self._testMethodName)
self.fail("Fails in releasing security groups in the %s", self._testMethodName)

if self.test_world.get('keypair_names'):
self.logger.debug("Tearing down keypairs...")
if not self.reset_world_keypair_names(self.test_world):
self.fail("Fails tearing down keypairs in test %s", self._testMethodName)
self.fail("Fails in releasing keypairs in the %s", self._testMethodName)

if self.test_world.get('ports'):
self.logger.debug("Tearing down ports...")
if not self.reset_world_ports(self.test_world):
self.fail("Fails tearing down ports in test %s", self._testMethodName)
self.fail("Fails in releasing ports in the %s", self._testMethodName)

if self.test_world.get('networks'):
self.logger.debug("Tearing down networks...")
if not self.reset_world_networks(self.test_world):
self.fail("Fails tearing down networks in test ".self._testMethodName)
self.fail("Fails in releasing networks in the %s", self._testMethodName)

if self.test_world.get('routers'):
self.logger.debug("Tearing down routers...")
if not self.reset_world_routers(self.test_world):
self.fail("Fails tearing down routers in test ".self._testMethodName)
self.fail("Fails in releasing routers in the %s", self._testMethodName)

if self.test_world.get('allocated_ips'):
self.logger.debug("Tearing down allocated IPs...")
if not self.reset_world_allocated_ips(self.test_world):
self.fail("Fails tearing down allocated IPs in test ".self._testMethodName)
self.fail("Fails in releasing IPs in the %s", self._testMethodName)

if self.test_world.get('containers'):
self.logger.debug("Tearing down containers...")
if not self.reset_world_containers(self.test_world):
self.fail("Fails tearing down containers in test ".self._testMethodName)
self.fail("Fails in releasing containers in the %s", self._testMethodName)

if self.test_world.get('local_objects'):
self.logger.debug("Tearing down local objects...")
if not self.reset_world_local_objects(self.test_world):
self.fail("Fails tearing down local in test ".self._testMethodName)
self.fail("Fails in releasing local objects in the %s", self._testMethodName)

0 comments on commit c5ad205

Please sign in to comment.