Merge "Rename list_users_for_tenant to list_tenant_users"
This commit is contained in:
commit
959a513f3f
@ -146,7 +146,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest):
|
||||
user_ids.append(user2['id'])
|
||||
self.data.users.append(user2)
|
||||
# List of users for the respective tenant ID
|
||||
body = (self.client.list_users_for_tenant(self.data.tenant['id'])
|
||||
body = (self.client.list_tenant_users(self.data.tenant['id'])
|
||||
['users'])
|
||||
for i in body:
|
||||
fetched_user_ids.append(i['id'])
|
||||
@ -182,7 +182,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest):
|
||||
second_user['id'],
|
||||
role['id'])['role']
|
||||
# List of users with roles for the respective tenant ID
|
||||
body = (self.client.list_users_for_tenant(self.data.tenant['id'])
|
||||
body = (self.client.list_tenant_users(self.data.tenant['id'])
|
||||
['users'])
|
||||
for i in body:
|
||||
fetched_user_ids.append(i['id'])
|
||||
|
@ -247,4 +247,4 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest):
|
||||
# List the users with invalid tenant id
|
||||
for invalid in invalid_id:
|
||||
self.assertRaises(lib_exc.NotFound,
|
||||
self.client.list_users_for_tenant, invalid)
|
||||
self.client.list_tenant_users, invalid)
|
||||
|
@ -213,7 +213,7 @@ class IdentityClient(service_client.ServiceClient):
|
||||
self.expected_success(204, resp.status)
|
||||
return service_client.ResponseBody(resp, body)
|
||||
|
||||
def list_users_for_tenant(self, tenant_id):
|
||||
def list_tenant_users(self, tenant_id):
|
||||
"""List users for a Tenant."""
|
||||
resp, body = self.get('/tenants/%s/users' % tenant_id)
|
||||
self.expected_success(200, resp.status)
|
||||
@ -221,7 +221,7 @@ class IdentityClient(service_client.ServiceClient):
|
||||
return service_client.ResponseBody(resp, body)
|
||||
|
||||
def get_user_by_username(self, tenant_id, username):
|
||||
users = self.list_users_for_tenant(tenant_id)['users']
|
||||
users = self.list_tenant_users(tenant_id)['users']
|
||||
for user in users:
|
||||
if user['name'] == username:
|
||||
return user
|
||||
|
Loading…
Reference in New Issue
Block a user