summaryrefslogtreecommitdiff
path: root/tests/test_urlparser.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-09-28 21:56:31 +0000
committerianb <devnull@localhost>2005-09-28 21:56:31 +0000
commit1b9db3a92fb27031740eb12257b94bc67062af3c (patch)
tree70bb4e482d449a9e3e86bd042a5cfd27b1913b16 /tests/test_urlparser.py
parentdf0fbe46078a2e8b0c871c54512faea869244598 (diff)
downloadpaste-1b9db3a92fb27031740eb12257b94bc67062af3c.tar.gz
Added parser that reads files from an egg using pkg_resources
Diffstat (limited to 'tests/test_urlparser.py')
-rw-r--r--tests/test_urlparser.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_urlparser.py b/tests/test_urlparser.py
index 5a1d518..a6d66bb 100644
--- a/tests/test_urlparser.py
+++ b/tests/test_urlparser.py
@@ -75,3 +75,23 @@ def test_not_found_hook():
assert res.status == 200
assert 'user: bob' in res
+def test_static_parser():
+ app = StaticURLParser(path('find_file'))
+ testapp = TestApp(app)
+ res = testapp.get('', status=301)
+ res = testapp.get('/', status=404)
+ res = testapp.get('/index.txt')
+ assert res.body.strip() == 'index1'
+ res = testapp.get('/index.txt/foo', status=500)
+
+def test_egg_parser():
+ app = PkgResourcesParser('Paste', 'paste')
+ testapp = TestApp(app)
+ res = testapp.get('', status=301)
+ res = testapp.get('/', status=404)
+ res = testapp.get('/flup_session', status=404)
+ res = testapp.get('/util/classinit.py')
+ assert 'ClassInitMeta' in res
+ res = testapp.get('/util/classinit', status=404)
+ res = testapp.get('/util', status=301)
+ res = testapp.get('/util/classinit.py/foo', status=500)