diff --git a/tempest/api/compute/admin/test_agents.py b/tempest/api/compute/admin/test_agents.py index 69cbfb5dab..090137498f 100644 --- a/tempest/api/compute/admin/test_agents.py +++ b/tempest/api/compute/admin/test_agents.py @@ -86,7 +86,7 @@ class AgentsAdminTestJSON(base.BaseV2ComputeAdminTest): body = self.client.create_agent(**self.params_agent)['agent'] self.addCleanup(self.client.delete_agent, body['agent_id']) agents = self.client.list_agents()['agents'] - self.assertNotEmpty(agents, 'Cannot get any agents.(%s)' % agents) + self.assertNotEmpty(agents, 'Cannot get any agents.') self.assertIn(body['agent_id'], map(lambda x: x['agent_id'], agents)) @decorators.idempotent_id('eabadde4-3cd7-4ec4-a4b5-5a936d2d4408') @@ -104,7 +104,7 @@ class AgentsAdminTestJSON(base.BaseV2ComputeAdminTest): agent_id_xen = agent_xen['agent_id'] agents = (self.client.list_agents(hypervisor=agent_xen['hypervisor']) ['agents']) - self.assertNotEmpty(agents, 'Cannot get any agents.(%s)' % agents) + self.assertNotEmpty(agents, 'Cannot get any agents.') self.assertIn(agent_id_xen, map(lambda x: x['agent_id'], agents)) self.assertNotIn(body['agent_id'], map(lambda x: x['agent_id'], agents)) diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py index 0db802cf51..404fd94ca2 100644 --- a/tempest/api/compute/admin/test_hypervisor.py +++ b/tempest/api/compute/admin/test_hypervisor.py @@ -30,26 +30,23 @@ class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest): hypers = self.client.list_hypervisors()['hypervisors'] return hypers - def assertHypervisors(self, hypers): - self.assertNotEmpty(hypers, "No hypervisors found: %s" % hypers) - @decorators.idempotent_id('7f0ceacd-c64d-4e96-b8ee-d02943142cc5') def test_get_hypervisor_list(self): # List of hypervisor and available hypervisors hostname hypers = self._list_hypervisors() - self.assertHypervisors(hypers) + self.assertNotEmpty(hypers, "No hypervisors found.") @decorators.idempotent_id('1e7fdac2-b672-4ad1-97a4-bad0e3030118') def test_get_hypervisor_list_details(self): # Display the details of the all hypervisor hypers = self.client.list_hypervisors(detail=True)['hypervisors'] - self.assertHypervisors(hypers) + self.assertNotEmpty(hypers, "No hypervisors found.") @decorators.idempotent_id('94ff9eae-a183-428e-9cdb-79fde71211cc') def test_get_hypervisor_show_details(self): # Display the details of the specified hypervisor hypers = self._list_hypervisors() - self.assertHypervisors(hypers) + self.assertNotEmpty(hypers, "No hypervisors found.") details = self.client.show_hypervisor(hypers[0]['id'])['hypervisor'] self.assertNotEmpty(details) @@ -60,7 +57,7 @@ class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest): def test_get_hypervisor_show_servers(self): # Show instances about the specific hypervisors hypers = self._list_hypervisors() - self.assertHypervisors(hypers) + self.assertNotEmpty(hypers, "No hypervisors found.") hostname = hypers[0]['hypervisor_hostname'] hypervisors = (self.client.list_servers_on_hypervisor(hostname) @@ -116,7 +113,7 @@ class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest): @decorators.idempotent_id('d7e1805b-3b14-4a3b-b6fd-50ec6d9f361f') def test_search_hypervisor(self): hypers = self._list_hypervisors() - self.assertHypervisors(hypers) + self.assertNotEmpty(hypers, "No hypervisors found.") hypers = self.client.search_hypervisor( hypers[0]['hypervisor_hostname'])['hypervisors'] - self.assertHypervisors(hypers) + self.assertNotEmpty(hypers, "No hypervisors found.")