#18465: merge with 3.3.
This commit is contained in:
commit
06c9ab5666
|
@ -1,7 +1,7 @@
|
||||||
# test for xml.dom.minidom
|
# test for xml.dom.minidom
|
||||||
|
|
||||||
import pickle
|
import pickle
|
||||||
from test.support import verbose, run_unittest, findfile
|
from test.support import run_unittest, findfile
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
|
@ -310,9 +310,10 @@ class MinidomTest(unittest.TestCase):
|
||||||
self.confirm(len(child.attributes) == 0
|
self.confirm(len(child.attributes) == 0
|
||||||
and child.getAttributeNode("spam") is None)
|
and child.getAttributeNode("spam") is None)
|
||||||
dom2 = Document()
|
dom2 = Document()
|
||||||
child2 = dom2.appendChild(dom.createElement("foo"))
|
child2 = dom2.appendChild(dom2.createElement("foo"))
|
||||||
self.assertRaises(xml.dom.NotFoundErr, child.removeAttributeNode,
|
node2 = child2.getAttributeNode("spam")
|
||||||
node)
|
self.assertRaises(xml.dom.NotFoundErr, child2.removeAttributeNode,
|
||||||
|
node2)
|
||||||
dom.unlink()
|
dom.unlink()
|
||||||
|
|
||||||
def testHasAttribute(self):
|
def testHasAttribute(self):
|
||||||
|
@ -607,7 +608,7 @@ class MinidomTest(unittest.TestCase):
|
||||||
def testHasChildNodes(self):
|
def testHasChildNodes(self):
|
||||||
dom = parseString("<doc><foo/></doc>")
|
dom = parseString("<doc><foo/></doc>")
|
||||||
doc = dom.documentElement
|
doc = dom.documentElement
|
||||||
self.assertTrue(dom.hasChildNodes())
|
self.assertTrue(doc.hasChildNodes())
|
||||||
dom2 = parseString("<doc/>")
|
dom2 = parseString("<doc/>")
|
||||||
doc2 = dom2.documentElement
|
doc2 = dom2.documentElement
|
||||||
self.assertFalse(doc2.hasChildNodes())
|
self.assertFalse(doc2.hasChildNodes())
|
||||||
|
|
Loading…
Reference in New Issue