]> granicus.if.org Git - python/commitdiff
restore test un-intentionally removed in the xmlcore purge (revision 50941)
authorFred Drake <fdrake@acm.org>
Sat, 29 Jul 2006 18:19:19 +0000 (18:19 +0000)
committerFred Drake <fdrake@acm.org>
Sat, 29 Jul 2006 18:19:19 +0000 (18:19 +0000)
Lib/test/test_xml_etree.py

index 1e8aa2dbd69fd6e4859a00d61f1bfc6888b3e05c..78adb42e19142e128342326ad8ce031ec0fb59a8 100644 (file)
@@ -199,6 +199,21 @@ def parseliteral():
     'body'
     """
 
+
+def check_encoding(ET, encoding):
+    """
+    >>> from xml.etree import ElementTree as ET
+
+    >>> check_encoding(ET, "ascii")
+    >>> check_encoding(ET, "us-ascii")
+    >>> check_encoding(ET, "iso-8859-1")
+    >>> check_encoding(ET, "iso-8859-15")
+    >>> check_encoding(ET, "cp437")
+    >>> check_encoding(ET, "mac-roman")
+    """
+    ET.XML("<?xml version='1.0' encoding='%s'?><xml />" % encoding)
+
+
 #
 # xinclude tests (samples from appendix C of the xinclude specification)