summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_minidom.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_minidom.py')
-rw-r--r--Lib/test/test_minidom.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index dbdd25e..32bf385 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -76,6 +76,30 @@ def testAppendChild():
confirm(dom.documentElement.childNodes[-1].data == "Hello")
dom.unlink()
+def testLegalChildren():
+ dom = Document()
+ elem = dom.createElement('element')
+ text = dom.createTextNode('text')
+
+ try: dom.appendChild(text)
+ except HierarchyRequestErr: pass
+ else:
+ print "dom.appendChild didn't raise HierarchyRequestErr"
+
+ dom.appendChild(elem)
+ try: dom.insertBefore(text, elem)
+ except HierarchyRequestErr: pass
+ else:
+ print "dom.appendChild didn't raise HierarchyRequestErr"
+
+ try: dom.replaceChild(text, elem)
+ except HierarchyRequestErr: pass
+ else:
+ print "dom.appendChild didn't raise HierarchyRequestErr"
+
+ elem.appendChild(text)
+ dom.unlink()
+
def testNonZero():
dom = parse(tstfile)
confirm(dom)# should not be zero
@@ -279,7 +303,7 @@ def testTooManyDocumentElements():
def testCreateElementNS(): pass
-def testCreatAttributeNS(): pass
+def testCreateAttributeNS(): pass
def testParse(): pass