diff options
| author | Eli Bendersky <eliben@gmail.com> | 2012-07-13 06:52:39 (GMT) |
|---|---|---|
| committer | Eli Bendersky <eliben@gmail.com> | 2012-07-13 06:52:39 (GMT) |
| commit | 8a80502d2c80e4af771136bf7cefb6ecd7c7df4a (patch) | |
| tree | ff3789e4a75380a867728f64d9c48fdd3aab945b /Lib/test/test_minidom.py | |
| parent | b674dcf53eb2d17929214b042506c18df85a53d5 (diff) | |
| download | cpython-8a80502d2c80e4af771136bf7cefb6ecd7c7df4a.zip cpython-8a80502d2c80e4af771136bf7cefb6ecd7c7df4a.tar.gz cpython-8a80502d2c80e4af771136bf7cefb6ecd7c7df4a.tar.bz2 | |
Issue #15296: Fix minidom.toxml/toprettyxml for non-unicode encodings. Patch by Serhiy Storchaka, with some minor style adjustments by me.
Diffstat (limited to 'Lib/test/test_minidom.py')
| -rw-r--r-- | Lib/test/test_minidom.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index cc4c95b..0427ba3 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -1067,6 +1067,11 @@ class MinidomTest(unittest.TestCase): b'<?xml version="1.0" encoding="utf-8"?><foo>\xe2\x82\xac</foo>') self.assertEqual(doc.toxml('iso-8859-15'), b'<?xml version="1.0" encoding="iso-8859-15"?><foo>\xa4</foo>') + self.assertEqual(doc.toxml('us-ascii'), + b'<?xml version="1.0" encoding="us-ascii"?><foo>€</foo>') + self.assertEqual(doc.toxml('utf-16'), + '<?xml version="1.0" encoding="utf-16"?>' + '<foo>\u20ac</foo>'.encode('utf-16')) # Verify that character decoding errors throw exceptions instead # of crashing |
