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 | |
| 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')
| -rw-r--r-- | tests/test_urlparser.py | 20 | ||||
| -rw-r--r-- | tests/urlparser_data/find_file/dir with spaces/test 4.html | 1 | ||||
| -rw-r--r-- | tests/urlparser_data/find_file/test 3.html | 1 |
3 files changed, 22 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') diff --git a/tests/urlparser_data/find_file/dir with spaces/test 4.html b/tests/urlparser_data/find_file/dir with spaces/test 4.html new file mode 100644 index 0000000..1121e31 --- /dev/null +++ b/tests/urlparser_data/find_file/dir with spaces/test 4.html @@ -0,0 +1 @@ +test 4 diff --git a/tests/urlparser_data/find_file/test 3.html b/tests/urlparser_data/find_file/test 3.html new file mode 100644 index 0000000..954a536 --- /dev/null +++ b/tests/urlparser_data/find_file/test 3.html @@ -0,0 +1 @@ +test 3 |
