diff options
author | Ryan Petrello <lists@ryanpetrello.com> | 2013-09-30 16:23:18 -0400 |
---|---|---|
committer | Ryan Petrello <lists@ryanpetrello.com> | 2013-09-30 16:51:22 -0400 |
commit | 8287f6a81bc5ebe611be9837e88d2793087fbcf7 (patch) | |
tree | e3d2897d38feaa24048cdff40eeec3371bfdf4fd /pecan/tests | |
parent | 55075fb8cf58b0c4ba029cd097232118b079185c (diff) | |
download | pecan-8287f6a81bc5ebe611be9837e88d2793087fbcf7.tar.gz |
Resolve a bug in `_default` handlers used in `RestController`.
Fixes-bug: 1233258
Change-Id: I5494cf4fc607cdc6833733dc1bf4022daa4c262e
Diffstat (limited to 'pecan/tests')
-rw-r--r-- | pecan/tests/test_rest.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pecan/tests/test_rest.py b/pecan/tests/test_rest.py index c1f8acc..f53030a 100644 --- a/pecan/tests/test_rest.py +++ b/pecan/tests/test_rest.py @@ -1057,6 +1057,23 @@ class TestRestController(PecanTestCase): assert r.status_int == 200 assert r.body == b_('POST-2') + def test_nested_rest_with_default(self): + + class FooController(RestController): + + @expose() + def _default(self, *remainder): + return "DEFAULT %s" % remainder + + class RootController(RestController): + foo = FooController() + + app = TestApp(make_app(RootController())) + + r = app.get('/foo/missing') + assert r.status_int == 200 + assert r.body == b_("DEFAULT missing") + def test_dynamic_rest_lookup(self): class BarController(RestController): @expose() |