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!')
def test_higher_order_rot13(self): view = Lambdas() view.template = '{{#rot13}}abcdefghijklm{{/rot13}}' renderer = Renderer() actual = renderer.render(view) self.assertString(actual, u'nopqrstuvwxyz')
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')
def test_higher_order_lambda(self): view = Lambdas() view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}' renderer = Renderer() actual = renderer.render(view) self.assertString(actual, u'abcdefghijklmnopqrstuvwxyz')
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')
def test_partials_with_lambda(self): view = Lambdas() view.template = "{{>partial_with_lambda}}" self.assertEquals(view.render(), "nopqrstuvwxyz")
def test_hierarchical_partials_with_lambdas(self): view = Lambdas() view.template = '{{>partial_with_partial_and_lambda}}' self.assertEquals(view.render(), 'nopqrstuvwxyznopqrstuvwxyz')
def test_callables(self): view = Lambdas() view.template = '{{#replace_foo_with_bar}}foo != bar. oh, it does!{{/replace_foo_with_bar}}' self.assertEquals(view.render(), 'bar != bar. oh, it does!')
def test_higher_order_lambda(self): view = Lambdas() view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}' self.assertEquals(view.render(), 'abcdefghijklmnopqrstuvwxyz')
def test_higher_order_rot13(self): view = Lambdas() view.template = '{{#rot13}}abcdefghijklm{{/rot13}}' self.assertEquals(view.render(), 'nopqrstuvwxyz')