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

Method testNormalizeDeleteWithNextSibling

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

Source from the content-addressed store, hash-verified

1069 doc.unlink()
1070
1071 def testNormalizeDeleteWithNextSibling(self):
1072 doc = parseString("<doc/>")
1073 root = doc.documentElement
1074 root.appendChild(doc.createTextNode(""))
1075 root.appendChild(doc.createTextNode("second"))
1076 self.confirm(len(root.childNodes) == 2
1077 and root.childNodes.length == 2,
1078 "testNormalizeDeleteWithNextSibling -- preparation")
1079 doc.normalize()
1080 self.confirm(len(root.childNodes) == 1
1081 and root.childNodes.length == 1
1082 and root.firstChild.data == "second"
1083 and root.firstChild is root.lastChild
1084 and root.firstChild.nextSibling is None
1085 and root.firstChild.previousSibling is None
1086 , "testNormalizeDeleteWithNextSibling -- result")
1087 doc.unlink()
1088
1089 def testNormalizeDeleteWithTwoNonTextSiblings(self):
1090 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