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
This commit is contained in:
parent
161231058d
commit
278adf5c20
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user