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

Method testNamedNodeMapSetItem

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

Source from the content-addressed store, hash-verified

256 dom.unlink()
257
258 def testNamedNodeMapSetItem(self):
259 dom = Document()
260 elem = dom.createElement('element')
261 attrs = elem.attributes
262 attrs["foo"] = "bar"
263 a = attrs.item(0)
264 self.assertIs(a.ownerDocument, dom,
265 "NamedNodeMap.__setitem__() sets ownerDocument")
266 self.assertIs(a.ownerElement, elem,
267 "NamedNodeMap.__setitem__() sets ownerElement")
268 self.assertEqual(a.value, "bar",
269 "NamedNodeMap.__setitem__() sets value")
270 self.assertEqual(a.nodeValue, "bar",
271 "NamedNodeMap.__setitem__() sets nodeValue")
272 elem.unlink()
273 dom.unlink()
274
275 def testNonZero(self):
276 dom = parse(tstfile)

Callers

nothing calls this directly

Calls 7

createElementMethod · 0.95
unlinkMethod · 0.95
DocumentClass · 0.90
itemMethod · 0.45
assertIsMethod · 0.45
assertEqualMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected