Skip to content

Commit 393923f

Browse files
committed
Adding tests.
1 parent 60ad399 commit 393923f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lib/test/test_minidom.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import io
66
from test import support
77
import unittest
8+
from xml.etree import ElementTree
89

910
import xml.dom.minidom
1011

@@ -1663,5 +1664,14 @@ def test_cdata_parsing(self):
16631664
dom2 = parseString(dom1.toprettyxml())
16641665
self.checkWholeText(dom2.getElementsByTagName('node')[0].firstChild, '</data>')
16651666

1667+
def testQuoteEscape(self):
1668+
text = ElementTree.Element('text')
1669+
text.text = 'f&oo"b<a>r'
1670+
xml_string = ElementTree.tostring(text)
1671+
xml_tree = parseString(xml_string)
1672+
output = xml_tree.toprettyxml(indent=' ')
1673+
self.assertEqual(output.splitlines()[1], xml_string.decode('utf8'))
1674+
1675+
16661676
if __name__ == "__main__":
16671677
unittest.main()

0 commit comments

Comments
 (0)