diff options
author | R David Murray <rdmurray@bitdance.com> | 2011-10-01 20:19:51 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2011-10-01 20:19:51 (GMT) |
commit | 791744b07004222c31b4fca34e62607685aa11fa (patch) | |
tree | 2d3e20b01a563b90eaa634c5724b6a321196f8b5 /Lib/test | |
parent | d8c347a8de9d7b76d0980ac18511667ab1cb2a4f (diff) | |
download | cpython-791744b07004222c31b4fca34e62607685aa11fa.zip cpython-791744b07004222c31b4fca34e62607685aa11fa.tar.gz cpython-791744b07004222c31b4fca34e62607685aa11fa.tar.bz2 |
#4147: minidom's toprettyxml no longer adds whitespace to text nodes.
Patch by Dan Kenigsberg.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_minidom.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index 200b95d..5c09c46 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -446,6 +446,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 |