summaryrefslogtreecommitdiff
path: root/tests/urlparser_data/not_found/recur/__init__.py
diff options
context:
space:
mode:
authorMarc Abramowitz <marc@marc-abramowitz.com>2016-03-07 18:52:36 -0800
committerMarc Abramowitz <marc@marc-abramowitz.com>2016-03-07 18:52:36 -0800
commitcc83e06efff71b81ca5a3ac6df65775971181295 (patch)
treed52fa3f1a93730f263c2c5ac8266de8e5fb12abf /tests/urlparser_data/not_found/recur/__init__.py
downloadpaste-git-cc83e06efff71b81ca5a3ac6df65775971181295.tar.gz
tox.ini: Measure test coveragetox_coverage
Diffstat (limited to 'tests/urlparser_data/not_found/recur/__init__.py')
-rw-r--r--tests/urlparser_data/not_found/recur/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/urlparser_data/not_found/recur/__init__.py b/tests/urlparser_data/not_found/recur/__init__.py
new file mode 100644
index 0000000..48205a5
--- /dev/null
+++ b/tests/urlparser_data/not_found/recur/__init__.py
@@ -0,0 +1,9 @@
+def not_found_hook(environ, start_response):
+ urlparser = environ['paste.urlparser.not_found_parser']
+ path = environ.get('PATH_INFO', '')
+ if not path:
+ return urlparser.not_found(environ, start_response)
+ # Strip off leading _'s
+ path = '/' + path.lstrip('/').lstrip('_')
+ environ['PATH_INFO'] = path
+ return urlparser(environ, start_response)