summaryrefslogtreecommitdiff
path: root/tests/pkgs/notfoundview
diff options
context:
space:
mode:
authorMichael Merickel <github@m.merickel.org>2018-10-15 09:03:53 -0500
committerGitHub <noreply@github.com>2018-10-15 09:03:53 -0500
commit81576ee51564c49d5ff3c1c07f214f22a8438231 (patch)
tree5b3fe0b39a0fc33d545733d821738845909f638c /tests/pkgs/notfoundview
parent433efe06191a7007ca8c5bf8fafee5c7c1439ebb (diff)
parent17e3abf320f6d9cd90f7e5a0352280c2fef584af (diff)
downloadpyramid-81576ee51564c49d5ff3c1c07f214f22a8438231.tar.gz
pyramid-81576ee51564c49d5ff3c1c07f214f22a8438231.tar.bz2
pyramid-81576ee51564c49d5ff3c1c07f214f22a8438231.zip
Merge pull request #3387 from mmerickel/src-folder-refactor
refactor pyramid tests into a tests folder and package into a src folder
Diffstat (limited to 'tests/pkgs/notfoundview')
-rw-r--r--tests/pkgs/notfoundview/__init__.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/pkgs/notfoundview/__init__.py b/tests/pkgs/notfoundview/__init__.py
new file mode 100644
index 000000000..8ba3ff9ed
--- /dev/null
+++ b/tests/pkgs/notfoundview/__init__.py
@@ -0,0 +1,30 @@
+from pyramid.view import notfound_view_config, view_config
+from pyramid.response import Response
+
+@notfound_view_config(route_name='foo', append_slash=True)
+def foo_notfound(request): # pragma: no cover
+ return Response('foo_notfound')
+
+@notfound_view_config(route_name='baz')
+def baz_notfound(request):
+ return Response('baz_notfound')
+
+@notfound_view_config(append_slash=True)
+def notfound(request):
+ return Response('generic_notfound')
+
+@view_config(route_name='bar')
+def bar(request):
+ return Response('OK bar')
+
+@view_config(route_name='foo2')
+def foo2(request):
+ return Response('OK foo2')
+
+def includeme(config):
+ config.add_route('foo', '/foo')
+ config.add_route('foo2', '/foo/')
+ config.add_route('bar', '/bar/')
+ config.add_route('baz', '/baz')
+ config.scan('tests.pkgs.notfoundview')
+