diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-04-21 15:26:47 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-04-21 15:26:47 +0200 |
commit | 04ecd5542849191457ccfc3e42a39452db47825a (patch) | |
tree | b0a470e46326b709d090a900847bbb004d355607 /tests | |
parent | 4c177fce89fee925f0f4fbfde00ce2e1252562c0 (diff) | |
download | paste-04ecd5542849191457ccfc3e42a39452db47825a.tar.gz |
Strip trailing spaces
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_auth/test_auth_cookie.py | 2 | ||||
-rw-r--r-- | tests/test_cgitb_catcher.py | 8 | ||||
-rw-r--r-- | tests/test_config.py | 2 | ||||
-rw-r--r-- | tests/test_exceptions/test_error_middleware.py | 12 | ||||
-rw-r--r-- | tests/test_import_string.py | 4 | ||||
-rw-r--r-- | tests/test_proxy.py | 2 | ||||
-rw-r--r-- | tests/test_recursive.py | 16 | ||||
-rw-r--r-- | tests/test_registry.py | 10 | ||||
-rw-r--r-- | tests/test_request.py | 8 | ||||
-rw-r--r-- | tests/test_response.py | 2 | ||||
-rw-r--r-- | tests/test_session.py | 6 | ||||
-rw-r--r-- | tests/test_wsgiwrappers.py | 2 | ||||
-rw-r--r-- | tests/urlparser_data/hook/app.py | 2 | ||||
-rw-r--r-- | tests/urlparser_data/python/simpleapp.py | 2 | ||||
-rw-r--r-- | tests/urlparser_data/python/sub/simpleapp.py | 2 |
15 files changed, 40 insertions, 40 deletions
diff --git a/tests/test_auth/test_auth_cookie.py b/tests/test_auth/test_auth_cookie.py index d1db981..3bff2d8 100644 --- a/tests/test_auth/test_auth_cookie.py +++ b/tests/test_auth/test_auth_cookie.py @@ -15,7 +15,7 @@ from paste.auth import cookie from paste.wsgilib import raw_interactive, dump_environ from paste.response import header_value from paste.httpexceptions import * - + def build(application,setenv, *args, **kwargs): def setter(environ, start_response): save = environ['paste.auth.cookie'].append diff --git a/tests/test_cgitb_catcher.py b/tests/test_cgitb_catcher.py index 788ede2..c2c6632 100644 --- a/tests/test_cgitb_catcher.py +++ b/tests/test_cgitb_catcher.py @@ -11,7 +11,7 @@ def do_request(app, expect_status=500): res = testapp.get('', status=expect_status, expect_errors=True) return res - + ############################################################ ## Applications that raise exceptions @@ -69,7 +69,7 @@ def test_iter_app(): print(res) assert 'None raises error' in res assert 'yielder' in res - - - + + + diff --git a/tests/test_config.py b/tests/test_config.py index ea6be75..a23238e 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -55,7 +55,7 @@ def test_process_config(request_app=test_request_config): assert CONFIG[test_key] == 'bar' assert CONFIG['process_var'] == 'foo' CONFIG.pop_process_config() - + assert_raises(AttributeError, lambda: 'process_var' not in CONFIG) assert_raises(IndexError, CONFIG.pop_process_config) diff --git a/tests/test_exceptions/test_error_middleware.py b/tests/test_exceptions/test_error_middleware.py index a34de73..d8fd802 100644 --- a/tests/test_exceptions/test_error_middleware.py +++ b/tests/test_exceptions/test_error_middleware.py @@ -19,7 +19,7 @@ def do_request(app, expect_status=500): def clear_middleware(app): """ The fixture sets paste.throw_errors, which suppresses exactly what - we want to test in this case. This wrapper also strips exc_info + we want to test in this case. This wrapper also strips exc_info on the *first* call to start_response (but not the second, or subsequent calls. """ @@ -34,7 +34,7 @@ def clear_middleware(app): del environ['paste.throw_errors'] return app(environ, replacement) return clear_throw_errors - + ############################################################ ## Applications that raise exceptions @@ -81,7 +81,7 @@ def test_makes_exception(): def test_unicode_exception(): res = do_request(unicode_bad_app) - + def test_start_res(): res = do_request(start_response_app) @@ -101,7 +101,7 @@ def test_iter_app(): #print res assert 'None raises error' in res assert 'yielder' in res - - - + + + diff --git a/tests/test_import_string.py b/tests/test_import_string.py index 96526ac..262cbdd 100644 --- a/tests/test_import_string.py +++ b/tests/test_import_string.py @@ -11,6 +11,6 @@ def test_simple(): def test_complex(): assert eval_import('sys:version') is sys.version assert eval_import('os:getcwd()') == os.getcwd() - assert (eval_import('sys:version.split()[0]') == + assert (eval_import('sys:version.split()[0]') == sys.version.split()[0]) - + diff --git a/tests/test_proxy.py b/tests/test_proxy.py index 36d16b5..44db9f3 100644 --- a/tests/test_proxy.py +++ b/tests/test_proxy.py @@ -9,4 +9,4 @@ def test_paste_website(): app = TestApp(app) res = app.get('/') assert 'documentation' in res - + diff --git a/tests/test_recursive.py b/tests/test_recursive.py index 114592e..8d2f96b 100644 --- a/tests/test_recursive.py +++ b/tests/test_recursive.py @@ -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': diff --git a/tests/test_registry.py b/tests/test_registry.py index fdbc26c..af3a389 100644 --- a/tests/test_registry.py +++ b/tests/test_registry.py @@ -35,7 +35,7 @@ class RegistryUsingApp(object): self.var = var self.value = value self.raise_exc = raise_exc - + def __call__(self, environ, start_response): if 'paste.registry' in environ: environ['paste.registry'].register(self.var, self.value) @@ -50,7 +50,7 @@ class RegistryUsingIteratorApp(object): def __init__(self, var, value): self.var = var self.value = value - + def __call__(self, environ, start_response): if 'paste.registry' in environ: environ['paste.registry'].register(self.var, self.value) @@ -65,7 +65,7 @@ class RegistryMiddleMan(object): self.var = var self.value = value self.depth = depth - + def __call__(self, environ, start_response): if 'paste.registry' in environ: environ['paste.registry'].register(self.var, self.value) @@ -85,7 +85,7 @@ class RegistryMiddleMan(object): app_response.extend(['\nAppended by middleware!\nAppendValue at \ depth %s is %s' % (self.depth, str(regobj))]) return app_response - + def test_simple(): app = TestApp(simpleapp) @@ -150,7 +150,7 @@ def test_really_deep_registry(): for depth in valuelist: assert "AppendValue at depth %s is {'%s': %s}" % \ (depth, keylist[depth], depth) in res - + def test_iterating_response(): obj = {'hi':'people'} secondobj = {'bye':'friends'} diff --git a/tests/test_request.py b/tests/test_request.py index 3d882ed..f5b59d6 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -21,7 +21,7 @@ def test_gets(): res = app.get('/') assert 'Hello' in res assert "get is MultiDict([])" in res - + res = app.get('/?name=george') res.mustcontain("get is MultiDict([('name', 'george')])") res.mustcontain("Val is george") @@ -30,7 +30,7 @@ def test_language_parsing(): app = TestApp(simpleapp) res = app.get('/') assert "The languages are: ['en-us']" in res - + res = app.get('/', headers={'Accept-Language':'da, en-gb;q=0.8, en;q=0.7'}) assert "languages are: ['da', 'en-gb', 'en', 'en-us']" in res @@ -41,10 +41,10 @@ def test_mime_parsing(): app = TestApp(simpleapp) res = app.get('/', headers={'Accept':'text/html'}) assert "accepttypes is: ['text/html']" in res - + res = app.get('/', headers={'Accept':'application/xml'}) assert "accepttypes is: ['application/xml']" in res - + res = app.get('/', headers={'Accept':'application/xml,*/*'}) assert "accepttypes is: ['text/html', 'application/xml']" in res diff --git a/tests/test_response.py b/tests/test_response.py index d4d4b65..71f6f97 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -8,4 +8,4 @@ def test_replace_header(): replace_header(h, 'Content-Type', 'text/html') assert ('content-type', 'text/html') in h assert ('content-type', 'text/plain') not in h - + diff --git a/tests/test_session.py b/tests/test_session.py index 621d284..ca4de0c 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -26,7 +26,7 @@ def wsgi_app(environ, start_response): return ['foo'] wsgi_app = SessionMiddleware(wsgi_app) - + def test_app1(): app = TestApp(wsgi_app) res = app.get('/get1') @@ -48,5 +48,5 @@ def test_app2(): assert res.body == 'fluff' res = app.get('/get2') assert res.body == 'fluff' - - + + diff --git a/tests/test_wsgiwrappers.py b/tests/test_wsgiwrappers.py index b552f86..0448c69 100644 --- a/tests/test_wsgiwrappers.py +++ b/tests/test_wsgiwrappers.py @@ -42,7 +42,7 @@ def test_wsgirequest_charset(): # Tanaka, '田中' app = TestApp(AssertApp(assertfunc=valid_name(u'田中', encoding='UTF-8'))) res = app.get('/?name=%E7%94%B0%E4%B8%AD') - + # Nippon (Japan), '日本' app = TestApp(AssertApp(assertfunc=valid_name(u'日本', encoding='UTF-8', post=True))) diff --git a/tests/urlparser_data/hook/app.py b/tests/urlparser_data/hook/app.py index d2714e5..a96866c 100644 --- a/tests/urlparser_data/hook/app.py +++ b/tests/urlparser_data/hook/app.py @@ -2,4 +2,4 @@ def application(environ, start_response): start_response('200 OK', [('Content-type', 'text/html')]) return ['user: %s' % environ['app.user']] - + diff --git a/tests/urlparser_data/python/simpleapp.py b/tests/urlparser_data/python/simpleapp.py index cbef9f1..e13bb3e 100644 --- a/tests/urlparser_data/python/simpleapp.py +++ b/tests/urlparser_data/python/simpleapp.py @@ -3,4 +3,4 @@ def application(environ, start_response): ('test-header', 'TEST!')]) return ['test1'] - + diff --git a/tests/urlparser_data/python/sub/simpleapp.py b/tests/urlparser_data/python/sub/simpleapp.py index fd90966..ac83a56 100644 --- a/tests/urlparser_data/python/sub/simpleapp.py +++ b/tests/urlparser_data/python/sub/simpleapp.py @@ -3,4 +3,4 @@ def application(environ, start_response): ('test-header', 'TEST!')]) return ['subsimple'] - + |