From ed260611386264005b42d71fde123b67b9e6b568 Mon Sep 17 00:00:00 2001 From: Tushar Kalra Date: Mon, 24 Mar 2014 10:57:01 -0700 Subject: [PATCH] Some keystone V3 API tests throw incorrect errors Change-Id: I43a80861a087daa512ded7288ed2a4aa59363a7c Closes-Bug: 1295434 --- tempest/api/identity/admin/v3/test_credentials.py | 12 ++++++++---- tempest/api/identity/admin/v3/test_roles.py | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py index 4442f4a80d..6bb0ebec0c 100644 --- a/tempest/api/identity/admin/v3/test_credentials.py +++ b/tempest/api/identity/admin/v3/test_credentials.py @@ -36,21 +36,25 @@ class CredentialsTestJSON(base.BaseIdentityV3AdminTest): resp, cls.project = cls.client.create_project( data_utils.rand_name('project-'), description=data_utils.rand_name('project-desc-')) - assert resp['status'] == '201', "Expected %s" % resp['status'] + assert resp['status'] == '201', ( + "Expected 201, but got: %s" % resp['status']) cls.projects.append(cls.project['id']) resp, cls.user_body = cls.client.create_user( u_name, description=u_desc, password=u_password, email=u_email, project_id=cls.projects[0]) - assert resp['status'] == '201', "Expected: %s" % resp['status'] + assert resp['status'] == '201', ( + "Expected 201, but got: %s" % resp['status']) @classmethod def tearDownClass(cls): resp, _ = cls.client.delete_user(cls.user_body['id']) - assert resp['status'] == '204', "Expected: %s" % resp['status'] + assert resp['status'] == '204', ( + "Expected 204, but got: %s" % resp['status']) for p in cls.projects: resp, _ = cls.client.delete_project(p) - assert resp['status'] == '204', "Expected: %s" % resp['status'] + assert resp['status'] == '204', ( + "Expected 204, but got: %s" % resp['status']) super(CredentialsTestJSON, cls).tearDownClass() def _delete_credential(self, cred_id): diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py index c63231f9e7..30d78a7868 100644 --- a/tempest/api/identity/admin/v3/test_roles.py +++ b/tempest/api/identity/admin/v3/test_roles.py @@ -47,7 +47,8 @@ class RolesV3TestJSON(base.BaseIdentityV3AdminTest): resp[4], cls.role = cls.client.create_role( data_utils.rand_name('Role-')) for r in resp: - assert r['status'] == '201', "Expected: %s" % r['status'] + assert r['status'] == '201', ( + "Expected 201, but got: %s" % r['status']) @classmethod def tearDownClass(cls): @@ -61,7 +62,8 @@ class RolesV3TestJSON(base.BaseIdentityV3AdminTest): cls.client.update_domain(cls.domain['id'], enabled=False) resp[4], _ = cls.client.delete_domain(cls.domain['id']) for r in resp: - assert r['status'] == '204', "Expected: %s" % r['status'] + assert r['status'] == '204', ( + "Expected 204, but got: %s" % r['status']) super(RolesV3TestJSON, cls).tearDownClass() def _list_assertions(self, resp, body, fetched_role_ids, role_id):