当前位置: 首页>>代码示例>>Python>>正文


Python AppConfig.setup_kajiki_renderer方法代码示例

本文整理汇总了Python中tg.configuration.AppConfig.setup_kajiki_renderer方法的典型用法代码示例。如果您正苦于以下问题:Python AppConfig.setup_kajiki_renderer方法的具体用法?Python AppConfig.setup_kajiki_renderer怎么用?Python AppConfig.setup_kajiki_renderer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tg.configuration.AppConfig的用法示例。


在下文中一共展示了AppConfig.setup_kajiki_renderer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import setup_kajiki_renderer [as 别名]

#.........这里部分代码省略.........
        self.config.call_on_shutdown = ['not callable']
        self.config._setup_startup_and_shutdown()

    @raises(AtExitTestException)
    def test_setup_startup_and_shutdown_shutdown_callable(self):
        def func():
            raise AtExitTestException()

        self.config.call_on_shutdown = [func]
        self.config._setup_startup_and_shutdown()
        atexit._run_exitfuncs()

    def test_setup_helpers_and_globals(self):
        self.config.setup_helpers_and_globals()

    def test_setup_sa_auth_backend(self):
        class ConfigWithSetupAuthBackend(self.config.__class__):
            called = []

            def setup_sa_auth_backend(self):
                self.called.append(True)

        conf = ConfigWithSetupAuthBackend()
        conf.setup_auth()

        assert len(ConfigWithSetupAuthBackend.called) >= 1

    def test_setup_chameleon_genshi_renderer(self):
        if PY3: raise SkipTest()

        self.config.paths.templates = 'template_path'
        self.config.setup_chameleon_genshi_renderer()

    def test_setup_kajiki_renderer(self):
        if PY3: raise SkipTest()

        self.config.paths.templates = 'template_path'
        self.config.setup_kajiki_renderer()

    def test_setup_genshi_renderer(self):
        self.config.paths.templates = 'template_path'
        self.config.setup_genshi_renderer()

    def test_setup_jinja_renderer(self):
        self.config.paths.templates = 'template_path'
        self.config.setup_jinja_renderer()

    def test_setup_mako_renderer(self):
        self.config.paths.templates = ['template_path']
        self.config.setup_mako_renderer(use_dotted_templatenames=True)

    def test_setup_jinja_without_package(self):
        class RootController(TGController):
            @expose()
            def test(self):
                return 'HI!'

        conf = AppConfig(minimal=True, root_controller=RootController())
        conf.renderers = ['jinja']
        app = conf.make_wsgi_app()

    def test_setup_sqlalchemy(self):
        class RootController(TGController):
            @expose()
            def test(self):
                return 'HI!'
开发者ID:Shamefox,项目名称:tg2,代码行数:70,代码来源:test_configuration.py


注:本文中的tg.configuration.AppConfig.setup_kajiki_renderer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。