summaryrefslogtreecommitdiff
path: root/tests/test_config/pkgs/scannable/another.py
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2018-10-14 21:11:41 -0500
committerMichael Merickel <michael@merickel.org>2018-10-14 21:11:41 -0500
commit3670c2cdb732d378ba6d38e72e7cd875ff726aa9 (patch)
tree5213452a778c992d42602efe7d3b3655a349abd5 /tests/test_config/pkgs/scannable/another.py
parent2b024920847481592b1a13d4006d2a9fa8881d72 (diff)
downloadpyramid-3670c2cdb732d378ba6d38e72e7cd875ff726aa9.tar.gz
pyramid-3670c2cdb732d378ba6d38e72e7cd875ff726aa9.tar.bz2
pyramid-3670c2cdb732d378ba6d38e72e7cd875ff726aa9.zip
move tests out of the package
Diffstat (limited to 'tests/test_config/pkgs/scannable/another.py')
-rw-r--r--tests/test_config/pkgs/scannable/another.py69
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/test_config/pkgs/scannable/another.py b/tests/test_config/pkgs/scannable/another.py
new file mode 100644
index 000000000..529821b5c
--- /dev/null
+++ b/tests/test_config/pkgs/scannable/another.py
@@ -0,0 +1,69 @@
+from pyramid.view import view_config
+from pyramid.renderers import null_renderer
+
+@view_config(name='another', renderer=null_renderer)
+def grokked(context, request):
+ return 'another_grokked'
+
+@view_config(request_method='POST', name='another', renderer=null_renderer)
+def grokked_post(context, request):
+ return 'another_grokked_post'
+
+@view_config(name='another_stacked2', renderer=null_renderer)
+@view_config(name='another_stacked1', renderer=null_renderer)
+def stacked(context, request):
+ return 'another_stacked'
+
+class stacked_class(object):
+ def __init__(self, context, request):
+ self.context = context
+ self.request = request
+
+ def __call__(self):
+ return 'another_stacked_class'
+
+stacked_class = view_config(name='another_stacked_class1',
+ renderer=null_renderer)(stacked_class)
+stacked_class = view_config(name='another_stacked_class2',
+ renderer=null_renderer)(stacked_class)
+
+class oldstyle_grokked_class:
+ def __init__(self, context, request):
+ self.context = context
+ self.request = request
+
+ def __call__(self):
+ return 'another_oldstyle_grokked_class'
+
+oldstyle_grokked_class = view_config(name='another_oldstyle_grokked_class',
+ renderer=null_renderer)(
+ oldstyle_grokked_class)
+
+class grokked_class(object):
+ def __init__(self, context, request):
+ self.context = context
+ self.request = request
+
+ def __call__(self):
+ return 'another_grokked_class'
+
+grokked_class = view_config(name='another_grokked_class',
+ renderer=null_renderer)(grokked_class)
+
+class Foo(object):
+ def __call__(self, context, request):
+ return 'another_grokked_instance'
+
+grokked_instance = Foo()
+grokked_instance = view_config(name='another_grokked_instance',
+ renderer=null_renderer)(
+ grokked_instance)
+
+# ungrokkable
+
+A = 1
+B = {}
+
+def stuff():
+ """ """
+