summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_xml_etree.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_xml_etree.py')
-rw-r--r--Lib/test/test_xml_etree.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index d90f978..da1ad09 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -2286,6 +2286,15 @@ class IOTest(unittest.TestCase):
'''<?xml version='1.0' encoding='utf-16'?>\n'''
'''<site />'''.encode("utf-16"))
+ def test_tostringlist_invariant(self):
+ root = ET.fromstring('<tag>foo</tag>')
+ self.assertEqual(
+ ET.tostring(root, 'unicode'),
+ ''.join(ET.tostringlist(root, 'unicode')))
+ self.assertEqual(
+ ET.tostring(root, 'utf-16'),
+ b''.join(ET.tostringlist(root, 'utf-16')))
+
class ParseErrorTest(unittest.TestCase):
def test_subclass(self):