diff options
author | Ryan Petrello <lists@ryanpetrello.com> | 2013-04-25 10:10:59 -0400 |
---|---|---|
committer | Ryan Petrello <lists@ryanpetrello.com> | 2013-04-25 10:10:59 -0400 |
commit | 9161aa1cf9ab787d9e31258832d7da2257143d43 (patch) | |
tree | 59368f2fb4725b3e5d8b35e68d0c1d3fb198cccf | |
parent | 475bade620ab55e7711336c83341f833f9a6af3d (diff) | |
download | pecan-9161aa1cf9ab787d9e31258832d7da2257143d43.tar.gz |
Remove some unnecessary cruft and improve test coverage for core.py
-rw-r--r-- | pecan/core.py | 3 | ||||
-rw-r--r-- | pecan/tests/test_base.py | 19 |
2 files changed, 18 insertions, 4 deletions
diff --git a/pecan/core.py b/pecan/core.py index e4fdd99..e1662ac 100644 --- a/pecan/core.py +++ b/pecan/core.py @@ -500,9 +500,6 @@ class Pecan(object): request.pecan['content_type'] = 'application/json' result = self.render(template, result) - if 'pecan.params' in request.environ: - params = request.environ.pop('pecan.params') - # If we are in a test request put the namespace where it can be # accessed directly if request.environ.get('paste.testing'): diff --git a/pecan/tests/test_base.py b/pecan/tests/test_base.py index 24ee248..d4b4371 100644 --- a/pecan/tests/test_base.py +++ b/pecan/tests/test_base.py @@ -848,7 +848,24 @@ class TestStreamedResponse(PecanTestCase): assert r.body == 'plain text' -class TestStateCleanup(PecanTestCase): +class TestThreadLocalState(PecanTestCase): + + def test_thread_local_dir(self): + """ + Threadlocal proxies for request and response should properly + proxy ``dir()`` calls to the underlying webob class. + """ + class RootController(object): + @expose() + def index(self): + assert 'method' in dir(request) + assert 'status' in dir(response) + return '/' + + app = TestApp(Pecan(RootController())) + r = app.get('/') + assert r.status_int == 200 + assert r.body == '/' def test_request_state_cleanup(self): """ |