diff options
Diffstat (limited to 'pecan/tests/test_generic.py')
-rw-r--r-- | pecan/tests/test_generic.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pecan/tests/test_generic.py b/pecan/tests/test_generic.py index 19127fc..0478799 100644 --- a/pecan/tests/test_generic.py +++ b/pecan/tests/test_generic.py @@ -86,3 +86,26 @@ class TestGeneric(PecanTestCase): r = app.delete('/sub/sub/joe/is/cool') assert r.status_int == 200 assert r.body == b_(dumps(dict(result='joe', args='is, cool'))) + + +class TestGenericWithSpecialMethods(PecanTestCase): + + def test_generics_not_allowed(self): + + class C(object): + + def _default(self): + pass + + def _lookup(self): + pass + + def _route(self): + pass + + for method in (C._default, C._lookup, C._route): + self.assertRaises( + ValueError, + expose(generic=True), + getattr(method, '__func__', method) + ) |