From 278adf5c20101a191979ce1e4d6277e5f209149e Mon Sep 17 00:00:00 2001 From: Hisashi Osanai Date: Tue, 14 Jul 2015 15:33:45 +0900 Subject: [PATCH] Make logic of unit tests responsive to the method names The two methods, test_authorize_succeeds_for_tenant_name_in_roles and test_authorize_succeeds_for_tenant_id_in_roles, have names that don't match what they are testing. tenant_name and tenant_id need to be switched. Change-Id: I7cb0a7d2b2111127fd5d6b55f2da6a3eadf2235d --- test/unit/common/middleware/test_keystoneauth.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/common/middleware/test_keystoneauth.py b/test/unit/common/middleware/test_keystoneauth.py index b9d216ae61..44195d30ff 100644 --- a/test/unit/common/middleware/test_keystoneauth.py +++ b/test/unit/common/middleware/test_keystoneauth.py @@ -664,18 +664,18 @@ class TestAuthorize(BaseTestAuthorize): identity = self._get_identity() user_name = identity['HTTP_X_USER_NAME'] user_id = identity['HTTP_X_USER_ID'] - tenant_id = identity['HTTP_X_TENANT_ID'] + tenant_name = identity['HTTP_X_TENANT_NAME'] for user in [user_id, user_name, '*']: - acl = '%s:%s' % (tenant_id, user) + acl = '%s:%s' % (tenant_name, user) self._check_authenticate(identity=identity, acl=acl) def test_authorize_succeeds_for_tenant_id_user_in_roles(self): identity = self._get_identity() user_name = identity['HTTP_X_USER_NAME'] user_id = identity['HTTP_X_USER_ID'] - tenant_name = identity['HTTP_X_TENANT_NAME'] + tenant_id = identity['HTTP_X_TENANT_ID'] for user in [user_id, user_name, '*']: - acl = '%s:%s' % (tenant_name, user) + acl = '%s:%s' % (tenant_id, user) self._check_authenticate(identity=identity, acl=acl) def test_authorize_succeeds_for_wildcard_tenant_user_in_roles(self):