def test_forceSpacingFromSpaceCharacters(self): """ If L{htmlIndent} detects consecutive space characters, it forces the rendering by substituting unbreakable space. """ line = " foo bar" self.assertEqual(" foo bar", htmlIndent(line))
def test_simpleInput(self): """ L{htmlIndent} transparently processes input with no special cases inside. """ line = "foo bar" self.assertEqual(line, htmlIndent(line))
def test_indentFromTabCharacters(self): """ L{htmlIndent} replaces tab characters with unbreakable spaces. """ line = "\tfoo" self.assertEqual(" foo", htmlIndent(line))
def test_stripTrailingWhitespace(self): """ L{htmlIndent} removes trailing whitespaces from its input. """ line = " foo bar " self.assertEqual(" foo bar", htmlIndent(line))
def test_escapeHtml(self): """ L{htmlIndent} escapes HTML from its input. """ line = "<br />" self.assertEqual("<br />", htmlIndent(line))
def MakeHtmlFriendly(line): return '%s<br />' % util.htmlIndent(line)