summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2001-02-21 01:30:26 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2001-02-21 01:30:26 (GMT)
commitbc8f72ccccb1acd697d5cdb3ff0711bfa98af00d (patch)
treeff95d66f3736e6e7fcd660a3a26c2b980fdbf099 /Lib/test
parent8b94b1c74a5d81ec0db14b0f1d4b65e6b592a680 (diff)
downloadcpython-bc8f72ccccb1acd697d5cdb3ff0711bfa98af00d.zip
cpython-bc8f72ccccb1acd697d5cdb3ff0711bfa98af00d.tar.gz
cpython-bc8f72ccccb1acd697d5cdb3ff0711bfa98af00d.tar.bz2
Patch #103854: raises an exception if a non-Attr node is passed to
NamedNodeMap.setNamedItem(). Martin, should I sync the PyXML tree, too, or do you want to do it? (I don't know if you're wrapping the 0.6.4 release right now.)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_minidom.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 4574803..5cc1e69 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -98,6 +98,17 @@ def testLegalChildren():
else:
print "dom.appendChild didn't raise HierarchyRequestErr"
+ nodemap = elem.attributes
+ try: nodemap.setNamedItem(text)
+ except HierarchyRequestErr: pass
+ else:
+ print "NamedNodeMap.setNamedItem didn't raise HierarchyRequestErr"
+
+ try: nodemap.setNamedItemNS(text)
+ except HierarchyRequestErr: pass
+ else:
+ print "NamedNodeMap.setNamedItemNS didn't raise HierarchyRequestErr"
+
elem.appendChild(text)
dom.unlink()