mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Issue #10590: xml.sax.parseString() now supports string argument.
This commit is contained in:
parent
f8aa133cce
commit
778db289b5
4 changed files with 19 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue