mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
#2927: Added the unescape() function to the html module.
This commit is contained in:
parent
5160da1afc
commit
4a9ee26750
7 changed files with 215 additions and 49 deletions
|
@ -569,18 +569,6 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
|
|||
for html, expected in data:
|
||||
self._run_check(html, expected)
|
||||
|
||||
def test_unescape_function(self):
|
||||
p = self.get_collector()
|
||||
self.assertEqual(p.unescape('&#bad;'),'&#bad;')
|
||||
self.assertEqual(p.unescape('&'),'&')
|
||||
# see #12888
|
||||
self.assertEqual(p.unescape('{ ' * 1050), '{ ' * 1050)
|
||||
# see #15156
|
||||
self.assertEqual(p.unescape('ÉricÉric'
|
||||
'&alphacentauriαcentauri'),
|
||||
'ÉricÉric&alphacentauriαcentauri')
|
||||
self.assertEqual(p.unescape('&co;'), '&co;')
|
||||
|
||||
def test_broken_comments(self):
|
||||
html = ('<! not really a comment >'
|
||||
'<! not a comment either -->'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue