mirror of
https://github.com/python/cpython.git
synced 2025-12-07 17:57:56 +00:00
Updated test suite to latest pulldom changes.
This commit is contained in:
parent
ec964d5b21
commit
5bad5a4be2
2 changed files with 18 additions and 18 deletions
|
|
@ -110,10 +110,6 @@ Test Succeeded testHasChildNodes
|
||||||
Passed assertion: len(Node.allnodes) == 0
|
Passed assertion: len(Node.allnodes) == 0
|
||||||
Test Succeeded testInsertBefore
|
Test Succeeded testInsertBefore
|
||||||
Passed assertion: len(Node.allnodes) == 0
|
Passed assertion: len(Node.allnodes) == 0
|
||||||
Passed testNonNSElements - siblings
|
|
||||||
Passed testNonNSElements - parents
|
|
||||||
Test Succeeded testNonNSElements
|
|
||||||
Passed assertion: len(Node.allnodes) == 0
|
|
||||||
Passed Test
|
Passed Test
|
||||||
Passed Test
|
Passed Test
|
||||||
Test Succeeded testNonZero
|
Test Succeeded testNonZero
|
||||||
|
|
@ -154,6 +150,10 @@ Passed Test
|
||||||
Passed Test
|
Passed Test
|
||||||
Test Succeeded testRemoveAttributeNode
|
Test Succeeded testRemoveAttributeNode
|
||||||
Passed assertion: len(Node.allnodes) == 0
|
Passed assertion: len(Node.allnodes) == 0
|
||||||
|
Passed testSAX2DOM - siblings
|
||||||
|
Passed testSAX2DOM - parents
|
||||||
|
Test Succeeded testSAX2DOM
|
||||||
|
Passed assertion: len(Node.allnodes) == 0
|
||||||
Test Succeeded testSetAttrValueandNodeValue
|
Test Succeeded testSetAttrValueandNodeValue
|
||||||
Passed assertion: len(Node.allnodes) == 0
|
Passed assertion: len(Node.allnodes) == 0
|
||||||
Passed testSiblings
|
Passed testSiblings
|
||||||
|
|
|
||||||
|
|
@ -337,21 +337,21 @@ def testParents():
|
||||||
|
|
||||||
doc.unlink()
|
doc.unlink()
|
||||||
|
|
||||||
def testNonNSElements():
|
def testSAX2DOM():
|
||||||
from xml.dom import pulldom
|
from xml.dom import pulldom
|
||||||
|
|
||||||
pulldom = pulldom.PullDOM()
|
sax2dom = pulldom.SAX2DOM()
|
||||||
pulldom.startDocument()
|
sax2dom.startDocument()
|
||||||
pulldom.startElement("doc", {})
|
sax2dom.startElement("doc", {})
|
||||||
pulldom.characters("text")
|
sax2dom.characters("text")
|
||||||
pulldom.startElement("subelm", {})
|
sax2dom.startElement("subelm", {})
|
||||||
pulldom.characters("text")
|
sax2dom.characters("text")
|
||||||
pulldom.endElement("subelm")
|
sax2dom.endElement("subelm")
|
||||||
pulldom.characters("text")
|
sax2dom.characters("text")
|
||||||
pulldom.endElement("doc")
|
sax2dom.endElement("doc")
|
||||||
pulldom.endDocument()
|
sax2dom.endDocument()
|
||||||
|
|
||||||
doc = pulldom.document
|
doc = sax2dom.document
|
||||||
root = doc.documentElement
|
root = doc.documentElement
|
||||||
(text1, elm1, text2) = root.childNodes
|
(text1, elm1, text2) = root.childNodes
|
||||||
text3 = elm1.childNodes[0]
|
text3 = elm1.childNodes[0]
|
||||||
|
|
@ -363,13 +363,13 @@ def testNonNSElements():
|
||||||
text2.previousSibling is elm1 and
|
text2.previousSibling is elm1 and
|
||||||
text2.nextSibling is None and
|
text2.nextSibling is None and
|
||||||
text3.previousSibling is None and
|
text3.previousSibling is None and
|
||||||
text3.nextSibling is None, "testNonNSElements - siblings")
|
text3.nextSibling is None, "testSAX2DOM - siblings")
|
||||||
|
|
||||||
confirm(root.parentNode is doc and
|
confirm(root.parentNode is doc and
|
||||||
text1.parentNode is root and
|
text1.parentNode is root and
|
||||||
elm1.parentNode is root and
|
elm1.parentNode is root and
|
||||||
text2.parentNode is root and
|
text2.parentNode is root and
|
||||||
text3.parentNode is elm1, "testNonNSElements - parents")
|
text3.parentNode is elm1, "testSAX2DOM - parents")
|
||||||
|
|
||||||
doc.unlink()
|
doc.unlink()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue