diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-11-01 12:42:54 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-11-01 12:42:54 (GMT) |
commit | 18b0e5b79bb8c38abe69d2099c0f493e738b379a (patch) | |
tree | f216241ac99dd8b76112e6477776392afb26b40e /Lib | |
parent | 7de56f6a04ab60010b3e2185752b3ddf681d068d (diff) | |
download | cpython-18b0e5b79bb8c38abe69d2099c0f493e738b379a.zip cpython-18b0e5b79bb8c38abe69d2099c0f493e738b379a.tar.gz cpython-18b0e5b79bb8c38abe69d2099c0f493e738b379a.tar.bz2 |
#12008: add a test.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_htmlparser.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py index fd8447c..b85beab 100644 --- a/Lib/test/test_htmlparser.py +++ b/Lib/test/test_htmlparser.py @@ -377,6 +377,30 @@ class HTMLParserTolerantTestCase(TestCaseBase): ('endtag', 'html')], collector = self.collector) + def test_with_unquoted_attributes(self): + html = ("<html><body bgcolor=d0ca90 text='181008'>" + "<table cellspacing=0 cellpadding=1 width=100% ><tr>" + "<td align=left><font size=-1>" + "- <a href=/rabota/><span class=en> software-and-i</span></a>" + "- <a href='/1/'><span class=en> library</span></a></table>") + expected = [ + ('starttag', 'html', []), + ('starttag', 'body', [('bgcolor', 'd0ca90'), ('text', '181008')]), + ('starttag', 'table', + [('cellspacing', '0'), ('cellpadding', '1'), ('width', '100%')]), + ('starttag', 'tr', []), + ('starttag', 'td', [('align', 'left')]), + ('starttag', 'font', [('size', '-1')]), + ('data', '- '), ('starttag', 'a', [('href', '/rabota/')]), + ('starttag', 'span', [('class', 'en')]), ('data', ' software-and-i'), + ('endtag', 'span'), ('endtag', 'a'), + ('data', '- '), ('starttag', 'a', [('href', '/1/')]), + ('starttag', 'span', [('class', 'en')]), ('data', ' library'), + ('endtag', 'span'), ('endtag', 'a'), ('endtag', 'table') + ] + + self._run_check(html, expected, collector=self.collector) + def test_comma_between_attributes(self): self._run_check('<form action="/xxx.php?a=1&b=2&", ' 'method="post">', [ |