本文整理汇总了Python中examples.lambdas.Lambdas.template方法的典型用法代码示例。如果您正苦于以下问题:Python Lambdas.template方法的具体用法?Python Lambdas.template怎么用?Python Lambdas.template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类examples.lambdas.Lambdas
的用法示例。
在下文中一共展示了Lambdas.template方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hierarchical_partials_with_lambdas
# 需要导入模块: from examples.lambdas import Lambdas [as 别名]
# 或者: from examples.lambdas.Lambdas import template [as 别名]
def test_hierarchical_partials_with_lambdas(self):
view = Lambdas()
view.template = '{{>partial_with_partial_and_lambda}}'
renderer = Renderer(search_dirs=EXAMPLES_DIR)
actual = renderer.render(view)
self.assertString(actual, u'nopqrstuvwxyznopqrstuvwxyz')
示例2: test_higher_order_rot13
# 需要导入模块: from examples.lambdas import Lambdas [as 别名]
# 或者: from examples.lambdas.Lambdas import template [as 别名]
def test_higher_order_rot13(self):
view = Lambdas()
view.template = '{{#rot13}}abcdefghijklm{{/rot13}}'
renderer = Renderer()
actual = renderer.render(view)
self.assertString(actual, u'nopqrstuvwxyz')
示例3: test_higher_order_lambda
# 需要导入模块: from examples.lambdas import Lambdas [as 别名]
# 或者: from examples.lambdas.Lambdas import template [as 别名]
def test_higher_order_lambda(self):
view = Lambdas()
view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}'
renderer = Renderer()
actual = renderer.render(view)
self.assertString(actual, u'abcdefghijklmnopqrstuvwxyz')
示例4: test_partials_with_lambda
# 需要导入模块: from examples.lambdas import Lambdas [as 别名]
# 或者: from examples.lambdas.Lambdas import template [as 别名]
def test_partials_with_lambda(self):
view = Lambdas()
view.template = '{{>partial_with_lambda}}'
renderer = Renderer(search_dirs=EXAMPLES_DIR)
actual = renderer.render(view)
self.assertEqual(actual, u'nopqrstuvwxyz')
示例5: test_callables
# 需要导入模块: from examples.lambdas import Lambdas [as 别名]
# 或者: from examples.lambdas.Lambdas import template [as 别名]
def test_callables(self):
view = Lambdas()
view.template = '{{#replace_foo_with_bar}}foo != bar. oh, it does!{{/replace_foo_with_bar}}'
renderer = Renderer()
actual = renderer.render(view)
self.assertString(actual, u'bar != bar. oh, it does!')
示例6: test_hierarchical_partials_with_lambdas
# 需要导入模块: from examples.lambdas import Lambdas [as 别名]
# 或者: from examples.lambdas.Lambdas import template [as 别名]
def test_hierarchical_partials_with_lambdas(self):
view = Lambdas()
view.template = '{{>partial_with_partial_and_lambda}}'
self.assertEquals(view.render(), 'nopqrstuvwxyznopqrstuvwxyz')
示例7: test_higher_order_lambda
# 需要导入模块: from examples.lambdas import Lambdas [as 别名]
# 或者: from examples.lambdas.Lambdas import template [as 别名]
def test_higher_order_lambda(self):
view = Lambdas()
view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}'
self.assertEquals(view.render(), 'abcdefghijklmnopqrstuvwxyz')
示例8: test_higher_order_rot13
# 需要导入模块: from examples.lambdas import Lambdas [as 别名]
# 或者: from examples.lambdas.Lambdas import template [as 别名]
def test_higher_order_rot13(self):
view = Lambdas()
view.template = '{{#rot13}}abcdefghijklm{{/rot13}}'
self.assertEquals(view.render(), 'nopqrstuvwxyz')
示例9: test_partials_with_lambda
# 需要导入模块: from examples.lambdas import Lambdas [as 别名]
# 或者: from examples.lambdas.Lambdas import template [as 别名]
def test_partials_with_lambda(self):
view = Lambdas()
view.template = "{{>partial_with_lambda}}"
self.assertEquals(view.render(), "nopqrstuvwxyz")