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."
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, "foo."</p>\n<a name='bar'/>\n<p>And this paragraph should be named, "bar."</p>" actual_output = singhtext.text_to_html(self.input_text) assert actual_output == correct_output, "Names to HTML failure."
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."
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."