Add pagination to GET /tokens
* Partially fixes bug 928049 Change-Id: I21943dcc7cea4dabfab672e84fe507e78e430de4changes/89/3989/3
parent
d049c19227
commit
0e775d628b
@ -1,25 +1,36 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
import json
|
||||
|
||||
import webob
|
||||
|
||||
from keystone import test
|
||||
from keystone.common import wsgi
|
||||
|
||||
|
||||
class FakeApp(wsgi.Application):
|
||||
def index(self, context):
|
||||
return {'a': 'b'}
|
||||
|
||||
|
||||
class ApplicationTest(test.TestCase):
|
||||
def setUp(self):
|
||||
self.app = FakeApp()
|
||||
|
||||
def _make_request(self):
|
||||
req = webob.Request.blank('/')
|
||||
args = {'action': 'index', 'controller': self.app}
|
||||
def _make_request(self, url='/'):
|
||||
req = webob.Request.blank(url)
|
||||
args = {'action': 'index', 'controller': None}
|
||||
req.environ['wsgiorg.routing_args'] = [None, args]
|
||||
return req
|
||||
|
||||
def test_response_content_type(self):
|
||||
class FakeApp(wsgi.Application):
|
||||
def index(self, context):
|
||||
return {'a': 'b'}
|
||||
|
||||
app = FakeApp()
|
||||
req = self._make_request()
|
||||
resp = req.get_response(self.app)
|
||||
resp = req.get_response(app)
|
||||
self.assertEqual(resp.content_type, 'application/json')
|
||||
|
||||
def test_query_string_available(self):
|
||||
class FakeApp(wsgi.Application):
|
||||
def index(self, context):
|
||||
return context['query_string']
|
||||
|
||||
app = FakeApp()
|
||||
req = self._make_request(url='/?1=2')
|
||||
resp = req.get_response(app)
|
||||
self.assertEqual(json.loads(resp.body), {'1': '2'})
|
||||
|
Loading…
Reference in New Issue