Esempio n. 1
0
 def testSpecialLineInterference(self):
     """Make sure special lines don't interfere with headers."""
     input_text = '\n$foo\n== bar ==\nbaz\n'
     correct_output = '<h2> bar </h2>\n<p>baz</p>'
     actual_output = singhtext.text_to_html(input_text)
     assert "bar" in actual_output and \
            "h2" in actual_output, "$-line interference."
Esempio n. 2
0
 def testNamesHTML(self):
     """Check HTML produced by $name lines."""
     correct_output = "<p>This is a test.</p>\n<a name='foo'/>\n<p>This paragraph should be named, &quot;foo.&quot;</p>\n<a name='bar'/>\n<p>And this paragraph should be named, &quot;bar.&quot;</p>"
     actual_output = singhtext.text_to_html(self.input_text)
     assert actual_output == correct_output, "Names to HTML failure."
Esempio n. 3
0
 def testLiteralRegions(self):
     """Make sure #LITERAL regions work."""
     input_text = '#LITERAL\n<robot>\n</robot>\n#LITERAL\n'
     actual_output = singhtext.text_to_html(input_text)
     correct_output = '<robot>\n</robot>\n'
     assert actual_output == correct_output, "Bad #LITERALs."
Esempio n. 4
0
 def testMultilineLinks(self):
     """Test links that span multiple lines, another way."""
     input_text = '[[foo]\n bar] [[baz]]'
     output = singhtext.text_to_html(input_text)
     assert ("[[" in output) == False, "Multi-line links fail."