(self)
| 374 | dom.unlink() |
| 375 | |
| 376 | def testRemoveAttributeNode(self): |
| 377 | dom = Document() |
| 378 | child = dom.appendChild(dom.createElement("foo")) |
| 379 | child.setAttribute("spam", "jam") |
| 380 | self.assertEqual(len(child.attributes), 1) |
| 381 | node = child.getAttributeNode("spam") |
| 382 | self.assertRaises(xml.dom.NotFoundErr, child.removeAttributeNode, |
| 383 | None) |
| 384 | self.assertIs(node, child.removeAttributeNode(node)) |
| 385 | self.assertEqual(len(child.attributes), 0) |
| 386 | self.assertIsNone(child.getAttributeNode("spam")) |
| 387 | dom2 = Document() |
| 388 | child2 = dom2.appendChild(dom2.createElement("foo")) |
| 389 | node2 = child2.getAttributeNode("spam") |
| 390 | self.assertRaises(xml.dom.NotFoundErr, child2.removeAttributeNode, |
| 391 | node2) |
| 392 | dom.unlink() |
| 393 | |
| 394 | def testHasAttribute(self): |
| 395 | dom = Document() |
nothing calls this directly
no test coverage detected