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

Method testRemoveAttrNS

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

Source from the content-addressed store, hash-verified

360 dom.unlink()
361
362 def testRemoveAttrNS(self):
363 dom = Document()
364 child = dom.appendChild(
365 dom.createElementNS("http://www.python.org", "python:abc"))
366 child.setAttributeNS("http://www.w3.org", "xmlns:python",
367 "http://www.python.org")
368 child.setAttributeNS("http://www.python.org", "python:abcattr", "foo")
369 self.assertRaises(xml.dom.NotFoundErr, child.removeAttributeNS,
370 "foo", "http://www.python.org")
371 self.assertEqual(len(child.attributes), 2)
372 child.removeAttributeNS("http://www.python.org", "abcattr")
373 self.assertEqual(len(child.attributes), 1)
374 dom.unlink()
375
376 def testRemoveAttributeNode(self):
377 dom = Document()

Callers

nothing calls this directly

Calls 8

appendChildMethod · 0.95
createElementNSMethod · 0.95
unlinkMethod · 0.95
DocumentClass · 0.90
setAttributeNSMethod · 0.80
removeAttributeNSMethod · 0.80
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected