Ejemplo n.º 1
0
    def testHelloWorld(self):
        rendered = nemoc.render(
            u"""
% ul
    %li
        Hello, World!
"""
        )
        r = re.sub(u"[ \f\r\t\n]+", u"", rendered)
        self.assertEqual(r, u"<ul><li>Hello,World!</li></ul>")
Ejemplo n.º 2
0
    def testRenderWithParams(self):
        rendered = nemoc.render(
            u"""
% html
  % body
    % span || Hello, ${name}!
    % span || Goodbye!
""",
            dict(name="John"),
        )
        r = re.sub(u"[ \f\r\t\n]+", u"", rendered)
        self.assertEqual(r, u"<html><body><span>Hello,John!</span><span>Goodbye!</span></body></html>")
Ejemplo n.º 3
0
 def testHelloWorldInJapanese(self):
     rendered = nemoc.render(SRC_TEXT)
     r = re.sub(u'[ \f\r\t\n]+', u'', rendered)
     self.assertEqual(r, RENDERED_TEXT_WO_SPACES)