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

Method testNormalizeDeleteAndCombine

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

Source from the content-addressed store, hash-verified

1107 doc.unlink()
1108
1109 def testNormalizeDeleteAndCombine(self):
1110 doc = parseString("<doc/>")
1111 root = doc.documentElement
1112 root.appendChild(doc.createTextNode(""))
1113 root.appendChild(doc.createTextNode("second"))
1114 root.appendChild(doc.createTextNode(""))
1115 root.appendChild(doc.createTextNode("fourth"))
1116 root.appendChild(doc.createTextNode(""))
1117 self.confirm(len(root.childNodes) == 5
1118 and root.childNodes.length == 5,
1119 "testNormalizeDeleteAndCombine -- preparation")
1120 doc.normalize()
1121 self.confirm(len(root.childNodes) == 1
1122 and root.childNodes.length == 1
1123 and root.firstChild is root.lastChild
1124 and root.firstChild.data == "secondfourth"
1125 and root.firstChild.previousSibling is None
1126 and root.firstChild.nextSibling is None
1127 , "testNormalizeDeleteAndCombine -- result")
1128 doc.unlink()
1129
1130 def testNormalizeRecursion(self):
1131 doc = parseString("<doc>"

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected