(self)
| 1128 | doc.unlink() |
| 1129 | |
| 1130 | def testNormalizeRecursion(self): |
| 1131 | doc = parseString("<doc>" |
| 1132 | "<o>" |
| 1133 | "<i/>" |
| 1134 | "t" |
| 1135 | # |
| 1136 | #x |
| 1137 | "</o>" |
| 1138 | "<o>" |
| 1139 | "<o>" |
| 1140 | "t2" |
| 1141 | #x2 |
| 1142 | "</o>" |
| 1143 | "t3" |
| 1144 | #x3 |
| 1145 | "</o>" |
| 1146 | # |
| 1147 | "</doc>") |
| 1148 | root = doc.documentElement |
| 1149 | root.childNodes[0].appendChild(doc.createTextNode("")) |
| 1150 | root.childNodes[0].appendChild(doc.createTextNode("x")) |
| 1151 | root.childNodes[1].childNodes[0].appendChild(doc.createTextNode("x2")) |
| 1152 | root.childNodes[1].appendChild(doc.createTextNode("x3")) |
| 1153 | root.appendChild(doc.createTextNode("")) |
| 1154 | self.confirm(len(root.childNodes) == 3 |
| 1155 | and root.childNodes.length == 3 |
| 1156 | and len(root.childNodes[0].childNodes) == 4 |
| 1157 | and root.childNodes[0].childNodes.length == 4 |
| 1158 | and len(root.childNodes[1].childNodes) == 3 |
| 1159 | and root.childNodes[1].childNodes.length == 3 |
| 1160 | and len(root.childNodes[1].childNodes[0].childNodes) == 2 |
| 1161 | and root.childNodes[1].childNodes[0].childNodes.length == 2 |
| 1162 | , "testNormalize2 -- preparation") |
| 1163 | doc.normalize() |
| 1164 | self.confirm(len(root.childNodes) == 2 |
| 1165 | and root.childNodes.length == 2 |
| 1166 | and len(root.childNodes[0].childNodes) == 2 |
| 1167 | and root.childNodes[0].childNodes.length == 2 |
| 1168 | and len(root.childNodes[1].childNodes) == 2 |
| 1169 | and root.childNodes[1].childNodes.length == 2 |
| 1170 | and len(root.childNodes[1].childNodes[0].childNodes) == 1 |
| 1171 | and root.childNodes[1].childNodes[0].childNodes.length == 1 |
| 1172 | , "testNormalize2 -- childNodes lengths") |
| 1173 | self.confirm(root.childNodes[0].childNodes[1].data == "tx" |
| 1174 | and root.childNodes[1].childNodes[0].childNodes[0].data == "t2x2" |
| 1175 | and root.childNodes[1].childNodes[1].data == "t3x3" |
| 1176 | , "testNormalize2 -- joined text fields") |
| 1177 | self.confirm(root.childNodes[0].childNodes[1].nextSibling is None |
| 1178 | and root.childNodes[0].childNodes[1].previousSibling |
| 1179 | is root.childNodes[0].childNodes[0] |
| 1180 | and root.childNodes[0].childNodes[0].previousSibling is None |
| 1181 | and root.childNodes[0].childNodes[0].nextSibling |
| 1182 | is root.childNodes[0].childNodes[1] |
| 1183 | and root.childNodes[1].childNodes[1].nextSibling is None |
| 1184 | and root.childNodes[1].childNodes[1].previousSibling |
| 1185 | is root.childNodes[1].childNodes[0] |
| 1186 | and root.childNodes[1].childNodes[0].previousSibling is None |
| 1187 | and root.childNodes[1].childNodes[0].nextSibling |
nothing calls this directly
no test coverage detected