예제 #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
파일: cl_command.py 프로젝트: kusoof/wprof
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))