예제 #1
0
    def test_can_use_internally_defined_arguments(self):
        """Can use argument names that are internally used by TG in controllers"""
        class App(controllers.RootController):
            @expose()
            def index(self, **kw):
                return "\n".join(["%s:%s" % i for i in kw.iteritems()])

        testutil.mount(App(), '/')
        response = self.app.get("/?format=foo&template=bar&fragment=boo")
        assert "format:foo" in response
        assert "template:bar" in response
        assert "fragment:boo" in response
예제 #2
0
    def test_can_use_internally_defined_arguments(self):
        """Can use argument names that are internally used by TG in controllers"""

        class App(controllers.RootController):

            @expose()
            def index(self, **kw):
                return "\n".join(["%s:%s" % i for i in kw.iteritems()])

        testutil.mount(App(), '/')
        response = self.app.get("/?format=foo&template=bar&fragment=boo")
        assert "format:foo" in response
        assert "template:bar" in response
        assert "fragment:boo" in response
def setup_module():
    testutil.unmount()
    testutil.mount(MyRoot())
    testutil.mount(NestedController(), "/nestedcontroller")
    testutil.start_server()
예제 #4
0
def setup_module():
    testutil.unmount()
    testutil.mount(MyRoot())
    testutil.start_server()
예제 #5
0
 def test_index_trailing_slash(self):
     """If there is no trailing slash on an index method call, redirect"""
     testutil.mount(SubApp(), '/')
     testutil.mount(SubApp(), '/foo')
     self.app.get("/foo", status=302)
예제 #6
0
 def setUp(self):
     testutil.mount(MyRoot(), '/')
     testutil.mount(SubApp(), '/subthing')
     testutil.mount(SubApp(), '/subthing/subsubthing')
     self.app = testutil.make_app()
     super(TestURLs, self).setUp()
예제 #7
0
def setup_module():
    testutil.unmount()
    testutil.mount(MyRoot())
    testutil.start_server()
예제 #8
0
 def test_index_trailing_slash(self):
     """If there is no trailing slash on an index method call, redirect"""
     testutil.mount(SubApp(), '/')
     testutil.mount(SubApp(), '/foo')
     self.app.get("/foo", status=302)
예제 #9
0
 def setUp(self):
     testutil.mount(MyRoot(), '/')
     testutil.mount(SubApp(), '/subthing')
     testutil.mount(SubApp(), '/subthing/subsubthing')
     self.app = testutil.make_app()
     super(TestURLs, self).setUp()