mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
#4147: minidom's toprettyxml no longer adds whitespace to text nodes.
Patch by Dan Kenigsberg.
This commit is contained in:
parent
f06eb46918
commit
c8faf9bb0c
2 changed files with 11 additions and 2 deletions
|
|
@ -439,6 +439,13 @@ class MinidomTest(unittest.TestCase):
|
|||
dom.unlink()
|
||||
self.confirm(domstr == str.replace("\n", "\r\n"))
|
||||
|
||||
def test_toPrettyXML_perserves_content_of_text_node(self):
|
||||
str = '<A>B</A>'
|
||||
dom = parseString(str)
|
||||
dom2 = parseString(dom.toprettyxml())
|
||||
self.assertEqual(dom.childNodes[0].childNodes[0].toxml(),
|
||||
dom2.childNodes[0].childNodes[0].toxml())
|
||||
|
||||
def testProcessingInstruction(self):
|
||||
dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
|
||||
pi = dom.documentElement.firstChild
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue