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