summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-14 16:15:16 +0000
committerGerrit Code Review <review@openstack.org>2013-06-14 16:15:16 +0000
commit9b08fee9dce4e9c4e9628f0c86ef4c94b1b3f910 (patch)
tree399b6926c5eaf3c89d99a681d364fc690389fb13 /tests
parent0e4976f79e8964b42161c13c870908b2e4e90ac5 (diff)
parentce0baf07c0484d7e65b1d93cdd1ec4a1f8fcd60a (diff)
downloadkeystone-9b08fee9dce4e9c4e9628f0c86ef4c94b1b3f910.tar.gz
keystone-9b08fee9dce4e9c4e9628f0c86ef4c94b1b3f910.tar.xz
keystone-9b08fee9dce4e9c4e9628f0c86ef4c94b1b3f910.zip
Merge "Allow request headers access in app context."
Diffstat (limited to 'tests')
-rw-r--r--tests/test_wsgi.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_wsgi.py b/tests/test_wsgi.py
index 2d81ba86..0cd6a733 100644
--- a/tests/test_wsgi.py
+++ b/tests/test_wsgi.py
@@ -84,6 +84,17 @@ class ApplicationTest(BaseWSGITest):
resp = req.get_response(FakeApp())
self.assertEqual(jsonutils.loads(resp.body), {'1': '2'})
+ def test_headers_available(self):
+ class FakeApp(wsgi.Application):
+ def index(self, context):
+ return context['headers']
+
+ app = FakeApp()
+ req = self._make_request(url='/?1=2')
+ req.headers['X-Foo'] = "bar"
+ resp = req.get_response(app)
+ self.assertIn('X-Foo', eval(resp.body))
+
def test_render_response(self):
data = {'attribute': 'value'}
body = '{"attribute": "value"}'