diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-04-22 02:33:32 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-04-22 02:33:32 +0200 |
commit | 916a56715c777e39461627ea564bc0625712c733 (patch) | |
tree | a58fb49cd65f9b7ff24029aeb4dfaccd657128dd /tests/test_recursive.py | |
parent | d705a0524606c7b9b11f935de5a69d173c61ec0d (diff) | |
parent | 6c4ef4b3876812e6bbbb3e4748793997067aa85c (diff) | |
download | paste-git-916a56715c777e39461627ea564bc0625712c733.tar.gz |
Merged in mfrobben/paste (pull request #21)
Fix bad reference to iterator variable
Diffstat (limited to 'tests/test_recursive.py')
-rw-r--r-- | tests/test_recursive.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/test_recursive.py b/tests/test_recursive.py index 114592e..1cb1984 100644 --- a/tests/test_recursive.py +++ b/tests/test_recursive.py @@ -1,14 +1,14 @@ -from .test_errordocument import error_docs_app, test_error_docs_app, simple_app +from .test_errordocument import simple_app from paste.fixture import * from paste.recursive import RecursiveMiddleware, ForwardRequestException def error_docs_app(environ, start_response): if environ['PATH_INFO'] == '/not_found': start_response("404 Not found", [('Content-type', 'text/plain')]) - return ['Not found'] + return [b'Not found'] elif environ['PATH_INFO'] == '/error': start_response("200 OK", [('Content-type', 'text/plain')]) - return ['Page not found'] + return [b'Page not found'] elif environ['PATH_INFO'] == '/recurse': raise ForwardRequestException('/recurse') else: @@ -43,15 +43,15 @@ def forward(app): else: raise AssertionError('Failed to detect forwarding loop') -def test_ForwardRequest_url(): +def test_ForwardRequest_url(): class TestForwardRequestMiddleware(Middleware): def __call__(self, environ, start_response): if environ['PATH_INFO'] != '/not_found': return self.app(environ, start_response) raise ForwardRequestException(self.url) forward(TestForwardRequestMiddleware(error_docs_app)) - -def test_ForwardRequest_environ(): + +def test_ForwardRequest_environ(): class TestForwardRequestMiddleware(Middleware): def __call__(self, environ, start_response): if environ['PATH_INFO'] != '/not_found': @@ -59,11 +59,11 @@ def test_ForwardRequest_environ(): environ['PATH_INFO'] = self.url raise ForwardRequestException(environ=environ) forward(TestForwardRequestMiddleware(error_docs_app)) - -def test_ForwardRequest_factory(): - + +def test_ForwardRequest_factory(): + from paste.errordocument import StatusKeeper - + class TestForwardRequestMiddleware(Middleware): def __call__(self, environ, start_response): if environ['PATH_INFO'] != '/not_found': @@ -96,7 +96,7 @@ def test_ForwardRequest_factory(): raise AssertionError('Failed to detect forwarding loop') # Test Deprecated Code -def test_ForwardRequestException(): +def test_ForwardRequestException(): class TestForwardRequestExceptionMiddleware(Middleware): def __call__(self, environ, start_response): if environ['PATH_INFO'] != '/not_found': |