MCPcopy Index your code
hub / github.com/python/cpython / testNormalizeCombineAndNextSibling

Method testNormalizeCombineAndNextSibling

Lib/test/test_minidom.py:1032–1051  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1030 doc.unlink()
1031
1032 def testNormalizeCombineAndNextSibling(self):
1033 doc = parseString("<doc/>")
1034 root = doc.documentElement
1035 root.appendChild(doc.createTextNode("first"))
1036 root.appendChild(doc.createTextNode("second"))
1037 root.appendChild(doc.createElement("i"))
1038 self.confirm(len(root.childNodes) == 3
1039 and root.childNodes.length == 3,
1040 "testNormalizeCombineAndNextSibling -- preparation")
1041 doc.normalize()
1042 self.confirm(len(root.childNodes) == 2
1043 and root.childNodes.length == 2
1044 and root.firstChild.data == "firstsecond"
1045 and root.firstChild is not root.lastChild
1046 and root.firstChild.nextSibling is root.lastChild
1047 and root.firstChild.previousSibling is None
1048 and root.lastChild.previousSibling is root.firstChild
1049 and root.lastChild.nextSibling is None
1050 , "testNormalizeCombinedAndNextSibling -- result")
1051 doc.unlink()
1052
1053 def testNormalizeDeleteWithPrevSibling(self):
1054 doc = parseString("<doc/>")

Callers

nothing calls this directly

Calls 7

confirmMethod · 0.95
parseStringFunction · 0.90
createTextNodeMethod · 0.80
createElementMethod · 0.80
appendChildMethod · 0.45
normalizeMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected