diff options
| author | pjenvey <devnull@localhost> | 2006-06-18 20:07:01 +0000 |
|---|---|---|
| committer | pjenvey <devnull@localhost> | 2006-06-18 20:07:01 +0000 |
| commit | 899bc9ef55578437f29a2c178f2d05fe2ebb372e (patch) | |
| tree | 92656e445634bbb7c696fefef98a089564b4b82c /tests/test_urlparser.py | |
| parent | 27c03f6b97bc1c49f5739c8e9f9bb5eb9d9c415e (diff) | |
| download | paste-899bc9ef55578437f29a2c178f2d05fe2ebb372e.tar.gz | |
Fixed urlparser classes to handle quoted (e.g. %20) URL paths.
Added tests for this
(Thanks Jose Galvez)
Diffstat (limited to 'tests/test_urlparser.py')
| -rw-r--r-- | tests/test_urlparser.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_urlparser.py b/tests/test_urlparser.py index ab6b2aa..cfad691 100644 --- a/tests/test_urlparser.py +++ b/tests/test_urlparser.py @@ -25,6 +25,18 @@ def test_find_file(): res = app.get('/test2.html') assert 'test2' in res assert res.header('content-type') == 'text/html' + res = app.get('/test 3.html') + assert 'test 3' in res + assert res.header('content-type') == 'text/html' + res = app.get('/test%203.html') + assert 'test 3' in res + assert res.header('content-type') == 'text/html' + res = app.get('/dir with spaces/test 4.html') + assert 'test 4' in res + assert res.header('content-type') == 'text/html' + res = app.get('/dir%20with%20spaces/test%204.html') + assert 'test 4' in res + assert res.header('content-type') == 'text/html' def test_deep(): app = make_app('deep') @@ -83,6 +95,14 @@ def test_static_parser(): res = testapp.get('/index.txt') assert res.body.strip() == 'index1' res = testapp.get('/index.txt/foo', status=400) + res = testapp.get('/test 3.html') + assert res.body.strip() == 'test 3' + res = testapp.get('/test%203.html') + assert res.body.strip() == 'test 3' + res = testapp.get('/dir with spaces/test 4.html') + assert res.body.strip() == 'test 4' + res = testapp.get('/dir%20with%20spaces/test%204.html') + assert res.body.strip() == 'test 4' def test_egg_parser(): app = PkgResourcesParser('Paste', 'paste') |
