(self)
| 1581 | |
| 1582 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 1583 | def testSetIdAttribute(self): |
| 1584 | doc = parseString("<doc a1='v' a2='w'/>") |
| 1585 | e = doc.documentElement |
| 1586 | a1 = e.getAttributeNode("a1") |
| 1587 | a2 = e.getAttributeNode("a2") |
| 1588 | self.confirm(doc.getElementById("v") is None |
| 1589 | and not a1.isId |
| 1590 | and not a2.isId) |
| 1591 | e.setIdAttribute("a1") |
| 1592 | self.confirm(e.isSameNode(doc.getElementById("v")) |
| 1593 | and a1.isId |
| 1594 | and not a2.isId) |
| 1595 | e.setIdAttribute("a2") |
| 1596 | self.confirm(e.isSameNode(doc.getElementById("v")) |
| 1597 | and e.isSameNode(doc.getElementById("w")) |
| 1598 | and a1.isId |
| 1599 | and a2.isId) |
| 1600 | # replace the a1 node; the new node should *not* be an ID |
| 1601 | a3 = doc.createAttribute("a1") |
| 1602 | a3.value = "v" |
| 1603 | e.setAttributeNode(a3) |
| 1604 | self.confirm(doc.getElementById("v") is None |
| 1605 | and e.isSameNode(doc.getElementById("w")) |
| 1606 | and not a1.isId |
| 1607 | and a2.isId |
| 1608 | and not a3.isId) |
| 1609 | # renaming an attribute should not affect its ID-ness: |
| 1610 | doc.renameNode(a2, xml.dom.EMPTY_NAMESPACE, "an") |
| 1611 | self.confirm(e.isSameNode(doc.getElementById("w")) |
| 1612 | and a2.isId) |
| 1613 | |
| 1614 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 1615 | def testSetIdAttributeNS(self): |
nothing calls this directly
no test coverage detected