summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_minidom.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-06-30 15:05:00 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-06-30 15:05:00 (GMT)
commit7d650ca83bfdc42e852a4a6af00b80d230ecc54a (patch)
tree3f421d109018e27740476facebbc2fef2e129907 /Lib/test/test_minidom.py
parent2ebfd09e5818b7c6d555bcb297ecbb7cf863fe2c (diff)
downloadcpython-7d650ca83bfdc42e852a4a6af00b80d230ecc54a.zip
cpython-7d650ca83bfdc42e852a4a6af00b80d230ecc54a.tar.gz
cpython-7d650ca83bfdc42e852a4a6af00b80d230ecc54a.tar.bz2
Implement the encoding argument for toxml and toprettyxml.
Document toprettyxml.
Diffstat (limited to 'Lib/test/test_minidom.py')
-rw-r--r--Lib/test/test_minidom.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 4483fc5..d398d73 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -606,6 +606,14 @@ def testSAX2DOM():
doc.unlink()
+def testEncodings():
+ doc = parseString('<foo>&#x20ac;</foo>')
+ confirm(doc.toxml() == u'<?xml version="1.0" ?>\n<foo>\u20ac</foo>'
+ and doc.toxml('utf-8') == '<?xml version="1.0" encoding="utf-8"?>\n<foo>\xe2\x82\xac</foo>'
+ and doc.toxml('iso-8859-15') == '<?xml version="1.0" encoding="iso-8859-15"?>\n<foo>\xa4</foo>',
+ "testEncodings - encoding EURO SIGN")
+ doc.unlink()
+
# --- MAIN PROGRAM
names = globals().keys()