コード例 #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
ファイル: test_codegen.py プロジェクト: podhmo/htmlpp
    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
ファイル: test_codegen.py プロジェクト: podhmo/htmlpp
    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)