Add failure message for services limits

When the conditions expected for testing services limits
aren't met, fail the test with a verbose message.

Change-Id: I767b867ef29af7e7d943fdd1e08efe854c75ec0f
This commit is contained in:
Isaac Mungai
2016-05-18 10:00:00 -04:00
parent 0a0915cac5
commit 239969dbac

View File

@@ -46,6 +46,17 @@ class TestServiceLimits(base.TestBase):
@ddt.data(1, 3, 5)
def test_check_imposed_limit_on_services(self, limit):
resp = self.service_limit_user_client.list_services()
body = resp.json()
if body["services"] != [] or body["links"] != []:
self.fail(
"Testing services limits expects an account that "
"doesn't have existing services. Found services: "
"{0}".format(body["services"])
)
resp = self.operator_client.admin_service_limit(
project_id=self.service_limit_user_client.project_id,
limit=limit)