Commit ad4a558a authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Added test case for legal DOM children

parent 291ed4fb
......@@ -76,7 +76,7 @@ Test Succeeded testClonePIShallow
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testComment
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCreatAttributeNS
Test Succeeded testCreateAttributeNS
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCreateElementNS
Passed assertion: len(Node.allnodes) == 0
......@@ -121,6 +121,8 @@ Passed testInsertBefore -- node properly placed in tree
Passed testInsertBefore -- node properly placed in tree
Test Succeeded testInsertBefore
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testLegalChildren
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testNonZero
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment