예제 #1
0
 def test_empty(self):
     from htmlpp.nodes import _Root
     ast = _Root("", {}, [])
     render = self._callFUT(ast)
     context = {}
     result = render(context)
     self.assertEqual(result.strip(), "")
예제 #2
0
    def test_empty(self):
        from htmlpp.nodes import _Root

        ast = _Root("", {}, [])
        render = self._callFUT(ast)
        context = {}
        result = render(context)
        self.assertEqual(result.strip(), "")
예제 #3
0
    def test_rawhtml(self):
        from htmlpp.nodes import _Root
        text = """
<!DOCTYPE html>
<html>
{% include "foo.bar.html" %}
{% for line in body%}
  <p>{{line}}</p>
{% endfor %}
</html>
"""
        ast = _Root(text, {}, [text])
        render = self._callFUT(ast)
        context = {}
        result = render(context)
        self.assert_normalized(result, text)
예제 #4
0
    def test_rawhtml(self):
        from htmlpp.nodes import _Root

        text = """
<!DOCTYPE html>
<html>
{% include "foo.bar.html" %}
{% for line in body%}
  <p>{{line}}</p>
{% endfor %}
</html>
"""
        ast = _Root(text, {}, [text])
        render = self._callFUT(ast)
        context = {}
        result = render(context)
        self.assert_normalized(result, text)