summaryrefslogtreecommitdiff
path: root/Lib/test/test_sgmllib.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-04-01 08:35:18 +0000
committerGeorg Brandl <georg@python.org>2006-04-01 08:35:18 +0000
commit7f6b67c2359d9b52b2eabc1e2ccff4cedb5c78b7 (patch)
tree85426998f3d08e048d4b0211361b7140b04bc414 /Lib/test/test_sgmllib.py
parent48d5e508ebc136f8f67a2cb2bdd29e55324f5a95 (diff)
downloadcpython-git-7f6b67c2359d9b52b2eabc1e2ccff4cedb5c78b7.tar.gz
patch #1462498: handle entityrefs in attribute values.
Diffstat (limited to 'Lib/test/test_sgmllib.py')
-rw-r--r--Lib/test/test_sgmllib.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_sgmllib.py b/Lib/test/test_sgmllib.py
index bc25bd0195..8e8b02f877 100644
--- a/Lib/test/test_sgmllib.py
+++ b/Lib/test/test_sgmllib.py
@@ -214,6 +214,20 @@ DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
("starttag", "e", [("a", "rgb(1,2,3)")]),
])
+ def test_attr_values_entities(self):
+ """Substitution of entities and charrefs in attribute values"""
+ # SF bug #1452246
+ self.check_events("""<a b=&lt; c=&lt;&gt; d=&lt-&gt; e='&lt; '
+ f="&xxx;" g='&#32;&#33;' h='&#500;' i='x?a=b&c=d;'>""",
+ [("starttag", "a", [("b", "<"),
+ ("c", "<>"),
+ ("d", "&lt->"),
+ ("e", "< "),
+ ("f", "&xxx;"),
+ ("g", " !"),
+ ("h", "&#500;"),
+ ("i", "x?a=b&c=d;"), ])])
+
def test_attr_funky_names(self):
self.check_events("""<a a.b='v' c:d=v e-f=v>""", [
("starttag", "a", [("a.b", "v"), ("c:d", "v"), ("e-f", "v")]),