summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/output/test_minidom8
-rw-r--r--Lib/test/test_minidom.py22
2 files changed, 30 insertions, 0 deletions
diff --git a/Lib/test/output/test_minidom b/Lib/test/output/test_minidom
index 14e8845..fc1017b 100644
--- a/Lib/test/output/test_minidom
+++ b/Lib/test/output/test_minidom
@@ -1,5 +1,7 @@
test_minidom
Passed testAAA
+Passed setAttribute() sets ownerDocument
+Passed setAttribute() sets ownerElement
Test Succeeded testAAA
Passed assertion: len(Node.allnodes) == 0
Passed testAAB
@@ -131,6 +133,12 @@ Test Succeeded testInsertBeforeFragment
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testLegalChildren
Passed assertion: len(Node.allnodes) == 0
+Passed NamedNodeMap.__setitem__() sets ownerDocument
+Passed NamedNodeMap.__setitem__() sets ownerElement
+Passed NamedNodeMap.__setitem__() sets value
+Passed NamedNodeMap.__setitem__() sets nodeValue
+Test Succeeded testNamedNodeMapSetItem
+Passed assertion: len(Node.allnodes) == 0
Passed test NodeList.item()
Test Succeeded testNodeListItem
Passed assertion: len(Node.allnodes) == 0
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index adac990..4483fc5 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -166,6 +166,23 @@ def testLegalChildren():
elem.appendChild(text)
dom.unlink()
+def testNamedNodeMapSetItem():
+ dom = Document()
+ elem = dom.createElement('element')
+ attrs = elem.attributes
+ attrs["foo"] = "bar"
+ a = attrs.item(0)
+ confirm(a.ownerDocument is dom,
+ "NamedNodeMap.__setitem__() sets ownerDocument")
+ confirm(a.ownerElement is elem,
+ "NamedNodeMap.__setitem__() sets ownerElement")
+ confirm(a.value == "bar",
+ "NamedNodeMap.__setitem__() sets value")
+ confirm(a.nodeValue == "bar",
+ "NamedNodeMap.__setitem__() sets nodeValue")
+ elem.unlink()
+ dom.unlink()
+
def testNonZero():
dom = parse(tstfile)
confirm(dom)# should not be zero
@@ -188,6 +205,11 @@ def testAAA():
el = dom.documentElement
el.setAttribute("spam", "jam2")
confirm(el.toxml() == '<abc spam="jam2"/>', "testAAA")
+ a = el.getAttributeNode("spam")
+ confirm(a.ownerDocument is dom,
+ "setAttribute() sets ownerDocument")
+ confirm(a.ownerElement is dom.documentElement,
+ "setAttribute() sets ownerElement")
dom.unlink()
def testAAB():