Remove string from URL in list_revoke_events()

The extra string is causing the self URL to be
"/OS-REVOKE/events/events" instead of just
"OS-REVOKE/events".

Change-Id: I3b4e53ffabee5156b2b82b5831cfe23e98527a3a
Closes-Bug: 1384457
This commit is contained in:
Rodrigo Duarte Sousa 2014-10-22 21:49:20 -03:00
parent 60266bbfbf
commit c3393fb33c
2 changed files with 8 additions and 1 deletions

View File

@ -38,7 +38,7 @@ class RevokeController(controller.V3Controller):
'next': None,
'self': RevokeController.base_url(
context,
path=context['path']) + '/events',
path=context['path']),
'previous': None}
}
return response

View File

@ -15,6 +15,7 @@ import uuid
from oslo.utils import timeutils
import six
from testtools import matchers
from keystone.common import dependency
from keystone.contrib.revoke import model
@ -66,6 +67,12 @@ class OSRevokeTests(test_v3.RestfulTestCase, test_v3.JsonHomeTestMixin):
del (event['issued_before'])
self.assertEqual(sample, event)
def test_revoked_list_self_url(self):
revoked_list_url = '/OS-REVOKE/events'
resp = self.get(revoked_list_url)
links = resp.json_body['links']
self.assertThat(links['self'], matchers.EndsWith(revoked_list_url))
def test_revoked_token_in_list(self):
user_id = uuid.uuid4().hex
expires_at = provider.default_expire_time()