コード例 #1
0
    def assert_loader_throws(self,
                             exception_class,
                             template,
                             debug=False,
                             **args):
        try:
            FileLoader(debug=debug).load_string(template)
        except exception_class:
            return

        raise AssertionError(
            'loading the template {} did not throw a {}'.format(
                template, exception_class.__name__))
コード例 #2
0
def get_loader(debug=False):
    rv = FileLoader(debug=debug)
    rv.add_path(os.path.join(data_dir, 'input'))
    return rv
コード例 #3
0
def render(template, debug=False, **args):
    compiled = FileLoader(debug=debug).load_string(template)
    return text_type(compiled.render(args))
コード例 #4
0
def get_loader(debug=False):
    rv = FileLoader(debug=debug)
    rv.add_path(os.path.join(data_dir, 'input'))
    return rv
コード例 #5
0
def render(template, debug=False, translatable=False, **args):
    compiled = FileLoader(debug=debug,
                          translatable=translatable).load_string(template)
    return str(compiled.render(args))