Commits

Rick Copeland committed 1f69333

Added test case for infinite recursion bug

Comments (0)

Files changed (1)

tests/test_tg_controller_dispatch.py

     @expose()
     def index(self):
         return "first controller with index"
-    
+
+class LookupControllerWithSubcontroller(TGController):
+
+    class SubController(object): pass
+
+    @expose()
+    def _lookup(self, a, *args):
+        return self.SubController(), args
 
 class RemoteErrorHandler(TGController):
     @expose()
 
     lookup = LookupController()
     lookup_with_args = LookupControllerWithArgs()
+    lookup_with_sub = LookupControllerWithSubcontroller()
     self_calling = SelfCallingLookupController()
 
     @expose(content_type='application/rss+xml')
         msg = 'EYE'
         assert msg in r, r
 
+    def test_lookup_with_sub(self):
+        self.app.get('/lookup_with_sub/EYE', status=404)
+
     def test_lookup_with_args(self):
         r = self.app.get('/lookup_with_args/get_here/got_here')
         msg = 'got_here'