diff options
author | ianb <devnull@localhost> | 2006-07-14 16:43:27 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-07-14 16:43:27 +0000 |
commit | 4faed50946111b3f687cba89d5a4ad5d6a11a95e (patch) | |
tree | 63f768fd5779745cfc10d12ca2013069ec3d2093 /tests/test_errordocument.py | |
parent | 9acb7d24a7aad19a01c3f03cfb9ea9716b322bdb (diff) | |
download | paste-4faed50946111b3f687cba89d5a4ad5d6a11a95e.tar.gz |
Added a middleware to clear out error bodies, making them more accessible to Apache; added an app_iter wrapper for chaining app_iters from multiple sources (needed for peeking at status)
Diffstat (limited to 'tests/test_errordocument.py')
-rw-r--r-- | tests/test_errordocument.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/test_errordocument.py b/tests/test_errordocument.py index fab7cca..51135b6 100644 --- a/tests/test_errordocument.py +++ b/tests/test_errordocument.py @@ -14,8 +14,7 @@ I also need to find out how to test that another response was correctly requested by the middleware. """ import os -import py.test -from paste.errordocument import forward, custom_forward +from paste.errordocument import forward, custom_forward, empty_error from paste.fixture import * def simple_app(environ, start_response): @@ -32,3 +31,15 @@ def test_ok(): assert res.header('content-type') == 'text/plain' assert res.full_status == '200 OK' assert 'requested page returned' in res + +def test_empty(): + app = TestApp(empty_error(simple_app)) + res = app.get('/') + assert res.header('content-type') == 'text/plain' + assert res.full_status == '200 OK' + assert 'requested page returned' in res + app = TestApp(empty_error(not_found_app)) + res = app.get('/', status=404) + assert 'requested page returned' not in res + assert res.body == '' + assert res.status == 404 |