summaryrefslogtreecommitdiff
path: root/pyramid/tests/test_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyramid/tests/test_config.py')
-rw-r--r--pyramid/tests/test_config.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pyramid/tests/test_config.py b/pyramid/tests/test_config.py
index 2bbd2e4aa..0a87f4d7f 100644
--- a/pyramid/tests/test_config.py
+++ b/pyramid/tests/test_config.py
@@ -1993,6 +1993,17 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(len(views), 1)
self.assertEqual(views[0]['decorator'], MyHandler._action_decorator)
+ def test_add_handler_with_action_decorator_no_classmethod(self):
+ config = self._makeOne(autocommit=True)
+ class MyHandler(object):
+ def _action_decorator(self, fn): # pragma: no cover
+ return fn
+ def action(self): # pragma: no cover
+ return 'response'
+ from pyramid.exceptions import ConfigurationError
+ self.assertRaises(ConfigurationError, config.add_handler,
+ 'name', '/{action}', MyHandler)
+
def test_add_handler_doesnt_mutate_expose_dict(self):
config = self._makeOne(autocommit=True)
views = []