示例#1
0
 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))
示例#2
0
 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))
示例#3
0
 def test_simpleInput(self):
     """
     L{htmlIndent} transparently processes input with no special cases
     inside.
     """
     line = "foo bar"
     self.assertEqual(line, htmlIndent(line))
示例#4
0
 def test_simpleInput(self):
     """
     L{htmlIndent} transparently processes input with no special cases
     inside.
     """
     line = "foo bar"
     self.assertEqual(line, htmlIndent(line))
示例#5
0
 def test_indentFromTabCharacters(self):
     """
     L{htmlIndent} replaces tab characters with unbreakable spaces.
     """
     line = "\tfoo"
     self.assertEqual("        foo", htmlIndent(line))
示例#6
0
 def test_stripTrailingWhitespace(self):
     """
     L{htmlIndent} removes trailing whitespaces from its input.
     """
     line = " foo bar  "
     self.assertEqual(" foo bar", htmlIndent(line))
示例#7
0
 def test_escapeHtml(self):
     """
     L{htmlIndent} escapes HTML from its input.
     """
     line = "<br />"
     self.assertEqual("&lt;br /&gt;", htmlIndent(line))
示例#8
0
def MakeHtmlFriendly(line):
  return '%s<br />' % util.htmlIndent(line)
示例#9
0
 def test_indentFromTabCharacters(self):
     """
     L{htmlIndent} replaces tab characters with unbreakable spaces.
     """
     line = "\tfoo"
     self.assertEqual("&nbsp; &nbsp; &nbsp; &nbsp; foo", htmlIndent(line))
示例#10
0
 def test_stripTrailingWhitespace(self):
     """
     L{htmlIndent} removes trailing whitespaces from its input.
     """
     line = " foo bar  "
     self.assertEqual(" foo bar", htmlIndent(line))
示例#11
0
 def test_escapeHtml(self):
     """
     L{htmlIndent} escapes HTML from its input.
     """
     line = "<br />"
     self.assertEqual("&lt;br /&gt;", htmlIndent(line))