MCPcopy Index your code
hub / github.com/RustPython/RustPython / testNormalizeDeleteAndCombine

Method testNormalizeDeleteAndCombine

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

Source from the content-addressed store, hash-verified

1120 doc.unlink()
1121
1122 def testNormalizeDeleteAndCombine(self):
1123 doc = parseString("<doc/>")
1124 root = doc.documentElement
1125 root.appendChild(doc.createTextNode(""))
1126 root.appendChild(doc.createTextNode("second"))
1127 root.appendChild(doc.createTextNode(""))
1128 root.appendChild(doc.createTextNode("fourth"))
1129 root.appendChild(doc.createTextNode(""))
1130 self.confirm(len(root.childNodes) == 5
1131 and root.childNodes.length == 5,
1132 "testNormalizeDeleteAndCombine -- preparation")
1133 doc.normalize()
1134 self.confirm(len(root.childNodes) == 1
1135 and root.childNodes.length == 1
1136 and root.firstChild is root.lastChild
1137 and root.firstChild.data == "secondfourth"
1138 and root.firstChild.previousSibling is None
1139 and root.firstChild.nextSibling is None
1140 , "testNormalizeDeleteAndCombine -- result")
1141 doc.unlink()
1142
1143 def testNormalizeRecursion(self):
1144 doc = parseString("<doc>"

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected