Remove unused test case

Getting a user's roles isn't going to be implemted according to bug reports
(bug 1418015 and bug 933565). This commit removes the test case from
test_content_types.py and removes documentation from example curl calls.

Change-Id: Id317cc28d961316be6a7b8278c5242382784f10f
Related-Bug: 933565
Related-Bug: 1418015
This commit is contained in:
Lance Bragstad 2015-02-09 19:27:53 +00:00
parent 4f0107e434
commit 2ef3cdf307
3 changed files with 1 additions and 38 deletions

View File

@ -1114,29 +1114,6 @@ Returns:
}
}
GET /users/{user_id}/roles
==========================
Retrieve the roles granted to a user, given a user ID:
.. code-block:: bash
$ curl -H "X-Auth-Token:999888777666" http://localhost:35357/v2.0/users/4/roles
Returns:
.. code-block:: javascript
{
"roles_links":[],
"roles":[
{
"id":"2",
"name":"KeystoneServiceAdmin"
}
]
}
GET /tokens/revoked
===================

View File

@ -192,7 +192,7 @@ class Role(controller.V2Controller):
# COMPAT(essex-3)
@controller.v2_deprecated
def get_user_roles(self, context, user_id, tenant_id=None):
def get_user_roles(self, context, user_id, tenant_id):
"""Get the roles for a user and tenant pair.
Since we're trying to ignore the idea of user-only roles we're
@ -200,10 +200,6 @@ class Role(controller.V2Controller):
"""
self.assert_admin(context)
if tenant_id is None:
raise exception.NotImplemented(message='User roles not supported: '
'tenant ID required')
roles = self.assignment_api.get_roles_for_user_and_project(
user_id, tenant_id)
return {'roles': [self.role_api.get_role(x)

View File

@ -260,16 +260,6 @@ class CoreApiTests(object):
token=token)
self.assertValidTenantResponse(r)
def test_get_user_roles(self):
# The server responds with a 501 Not Implemented. See bug 933565.
token = self.get_scoped_token()
self.admin_request(
path='/v2.0/users/%(user_id)s/roles' % {
'user_id': self.user_foo['id'],
},
token=token, expected_status=501)
def test_get_user_roles_with_tenant(self):
token = self.get_scoped_token()
r = self.admin_request(