MCPcopy Index your code
hub / github.com/python/cpython / testRemoveAttr

Method testRemoveAttr

Lib/test/test_minidom.py:351–360  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

349 dom.unlink()
350
351 def testRemoveAttr(self):
352 dom = Document()
353 child = dom.appendChild(dom.createElement("abc"))
354
355 child.setAttribute("def", "ghi")
356 self.assertEqual(len(child.attributes), 1)
357 self.assertRaises(xml.dom.NotFoundErr, child.removeAttribute, "foo")
358 child.removeAttribute("def")
359 self.assertEqual(len(child.attributes), 0)
360 dom.unlink()
361
362 def testRemoveAttrNS(self):
363 dom = Document()

Callers

nothing calls this directly

Calls 8

appendChildMethod · 0.95
createElementMethod · 0.95
unlinkMethod · 0.95
DocumentClass · 0.90
setAttributeMethod · 0.80
removeAttributeMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected