mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Merged revisions 83152 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83152 | andrew.kuchling | 2010-07-25 19:38:47 -0400 (Sun, 25 Jul 2010) | 1 line #777884: make .normalize() do nothing for childless nodes, instead of raising an exception ........
This commit is contained in:
parent
2a91ce8960
commit
53f94d0753
2 changed files with 12 additions and 0 deletions
|
@ -945,6 +945,14 @@ class MinidomTest(unittest.TestCase):
|
||||||
doc.unlink()
|
doc.unlink()
|
||||||
|
|
||||||
|
|
||||||
|
def testBug0777884(self):
|
||||||
|
doc = parseString("<o>text</o>")
|
||||||
|
text = doc.documentElement.childNodes[0]
|
||||||
|
self.assertEquals(text.nodeType, Node.TEXT_NODE)
|
||||||
|
# Should run quietly, doing nothing.
|
||||||
|
text.normalize()
|
||||||
|
doc.unlink()
|
||||||
|
|
||||||
def testBug1433694(self):
|
def testBug1433694(self):
|
||||||
doc = parseString("<o><i/>t</o>")
|
doc = parseString("<o><i/>t</o>")
|
||||||
node = doc.documentElement
|
node = doc.documentElement
|
||||||
|
|
|
@ -890,6 +890,10 @@ class Childless:
|
||||||
raise xml.dom.NotFoundErr(
|
raise xml.dom.NotFoundErr(
|
||||||
self.nodeName + " nodes do not have children")
|
self.nodeName + " nodes do not have children")
|
||||||
|
|
||||||
|
def normalize(self):
|
||||||
|
# For childless nodes, normalize() has nothing to do.
|
||||||
|
pass
|
||||||
|
|
||||||
def replaceChild(self, newChild, oldChild):
|
def replaceChild(self, newChild, oldChild):
|
||||||
raise xml.dom.HierarchyRequestErr(
|
raise xml.dom.HierarchyRequestErr(
|
||||||
self.nodeName + " nodes do not have children")
|
self.nodeName + " nodes do not have children")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue