示例#1
0
    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!')
示例#2
0
    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
0
    def test_higher_order_rot13(self):
        view = Lambdas()
        view.template = '{{#rot13}}abcdefghijklm{{/rot13}}'

        renderer = Renderer()
        actual = renderer.render(view)
        self.assertString(actual, u'nopqrstuvwxyz')
示例#4
0
    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')
示例#5
0
    def test_higher_order_lambda(self):
        view = Lambdas()
        view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}'

        renderer = Renderer()
        actual = renderer.render(view)
        self.assertString(actual, u'abcdefghijklmnopqrstuvwxyz')
示例#6
0
    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')
示例#7
0
    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_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!')
示例#9
0
    def test_higher_order_lambda(self):
        view = Lambdas()
        view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}'

        renderer = Renderer()
        actual = renderer.render(view)
        self.assertString(actual, u'abcdefghijklmnopqrstuvwxyz')
示例#10
0
    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')
示例#11
0
 def test_partials_with_lambda(self):
     view = Lambdas()
     view.template = "{{>partial_with_lambda}}"
     self.assertEquals(view.render(), "nopqrstuvwxyz")
示例#12
0
 def test_hierarchical_partials_with_lambdas(self):
     view = Lambdas()
     view.template = '{{>partial_with_partial_and_lambda}}'
     self.assertEquals(view.render(), 'nopqrstuvwxyznopqrstuvwxyz')
示例#13
0
 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!')
示例#14
0
 def test_higher_order_lambda(self):
     view = Lambdas()
     view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}'
     self.assertEquals(view.render(), 'abcdefghijklmnopqrstuvwxyz')
示例#15
0
 def test_higher_order_rot13(self):
     view = Lambdas()
     view.template = '{{#rot13}}abcdefghijklm{{/rot13}}'
     self.assertEquals(view.render(), 'nopqrstuvwxyz')
示例#16
0
 def test_hierarchical_partials_with_lambdas(self):
     view = Lambdas()
     view.template = '{{>partial_with_partial_and_lambda}}'
     self.assertEquals(view.render(), 'nopqrstuvwxyznopqrstuvwxyz')
示例#17
0
 def test_higher_order_lambda(self):
     view = Lambdas()
     view.template = '{{#sort}}zyxwvutsrqponmlkjihgfedcba{{/sort}}'
     self.assertEquals(view.render(), 'abcdefghijklmnopqrstuvwxyz')
示例#18
0
 def test_higher_order_rot13(self):
     view = Lambdas()
     view.template = '{{#rot13}}abcdefghijklm{{/rot13}}'
     self.assertEquals(view.render(), 'nopqrstuvwxyz')