コード例 #1
0
ファイル: test_html.py プロジェクト: twistedmove/templar
 def testHexUnescape(self):
     text = "'hello world'! This is a "test"."
     expect = """'hello world'! This is a "test"."""
     self.assertEqual(html.unescape(text), expect)
コード例 #2
0
ファイル: test_html.py プロジェクト: twistedmove/templar
 def testHexEscape(self):
     text = """
     'hello world'! This is a "test".
     """
     self.assertEqual(html.unescape(html.hex_escape(text)), text)
コード例 #3
0
ファイル: test_html.py プロジェクト: twistedmove/templar
 def testDecimalEscape(self):
     text = """
     'hello world'! This is a "test".
     """
     self.assertEqual(html.unescape(html.decimal_escape(text)), text)
コード例 #4
0
ファイル: test_html.py プロジェクト: twistedmove/templar
 def testDecimalUnescape(self):
     text = ''.join('&#{};'.format(ord(c))
                    for c in """'hello world'! This is a "test".""")
     expect = """'hello world'! This is a "test"."""
     self.assertEqual(html.unescape(text), expect)
コード例 #5
0
ファイル: test_html.py プロジェクト: guoguo12/templar
 def testHexUnescape(self):
     text = "'hello world'! This is a "test"."
     expect = """'hello world'! This is a "test"."""
     self.assertEqual(html.unescape(text), expect)
コード例 #6
0
ファイル: test_html.py プロジェクト: guoguo12/templar
 def testDecimalEscape(self):
     text = """
     'hello world'! This is a "test".
     """
     self.assertEqual(html.unescape(html.decimal_escape(text)), text)
コード例 #7
0
ファイル: test_html.py プロジェクト: guoguo12/templar
 def testHexEscape(self):
     text = """
     'hello world'! This is a "test".
     """
     self.assertEqual(html.unescape(html.hex_escape(text)), text)
コード例 #8
0
ファイル: test_html.py プロジェクト: guoguo12/templar
 def testDecimalUnescape(self):
     text = "".join("&#{};".format(ord(c)) for c in """'hello world'! This is a "test".""")
     expect = """'hello world'! This is a "test"."""
     self.assertEqual(html.unescape(text), expect)