summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sax.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-04 07:12:26 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-04 07:12:26 (GMT)
commit778db289b5a1968c67db195572f2384489cca20c (patch)
treebfff3b855d5beeda067bfe7e19d499158c4593d2 /Lib/test/test_sax.py
parentf8aa133cce70472ec7baa21c8b073891101dce15 (diff)
downloadcpython-778db289b5a1968c67db195572f2384489cca20c.zip
cpython-778db289b5a1968c67db195572f2384489cca20c.tar.gz
cpython-778db289b5a1968c67db195572f2384489cca20c.tar.bz2
Issue #10590: xml.sax.parseString() now supports string argument.
Diffstat (limited to 'Lib/test/test_sax.py')
-rw-r--r--Lib/test/test_sax.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
index ecfb391..85c1cfe 100644
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -200,6 +200,13 @@ class ParseTest(unittest.TestCase):
parseString(s, XMLGenerator(result, 'utf-8'))
self.assertEqual(result.getvalue(), xml_str(self.data, 'utf-8'))
+ def test_parseString_text(self):
+ encodings = ('us-ascii', 'iso-8859-1', 'utf-8',
+ 'utf-16', 'utf-16le', 'utf-16be')
+ for encoding in encodings:
+ self.check_parseString(xml_str(self.data, encoding))
+ self.check_parseString(self.data)
+
def test_parseString_bytes(self):
# UTF-8 is default encoding, US-ASCII is compatible with UTF-8,
# UTF-16 is autodetected