summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkmcclain <mark.mcclain@dreamhost.com>2013-04-25 07:43:30 -0700
committermarkmcclain <mark.mcclain@dreamhost.com>2013-04-25 07:43:30 -0700
commitb3587b4da87820885180848111529da3fda5a5f5 (patch)
tree0c929d6f0b2941336f185e667535a4a1efc3a0b0
parentd8a7d5d75328b82268e9175588f0737447bac835 (diff)
parent2ab1c2796afb47f634ffb46efd0bcfefbca82978 (diff)
downloadpecan-b3587b4da87820885180848111529da3fda5a5f5.tar.gz
Merge pull request #211 from ryanpetrello/next
Remove some unnecessary cruft and improve test coverage for core.py
-rw-r--r--.coveragerc3
-rw-r--r--pecan/core.py3
-rw-r--r--pecan/tests/test_base.py19
3 files changed, 21 insertions, 4 deletions
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..9e39bc8
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,3 @@
+[run]
+source=pecan
+omit=pecan/compat/dictconfig.py
diff --git a/pecan/core.py b/pecan/core.py
index 4b940af..46b160a 100644
--- a/pecan/core.py
+++ b/pecan/core.py
@@ -517,9 +517,6 @@ class Pecan(object):
req.pecan['content_type'] = 'application/json'
result = self.render(template, result)
- if 'pecan.params' in req.environ:
- params = req.environ.pop('pecan.params')
-
# If we are in a test request put the namespace where it can be
# accessed directly
if req.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):
"""