(self)
| 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>" |
nothing calls this directly
no test coverage detected