]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_codecencodings_hk.py
AppPkg/Applications/Python: Add Python 2.7.2 sources since the release of Python...
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / test / test_codecencodings_hk.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_codecencodings_hk.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_codecencodings_hk.py
new file mode 100644 (file)
index 0000000..53f3dd3
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/env python\r
+#\r
+# test_codecencodings_hk.py\r
+#   Codec encoding tests for HongKong encodings.\r
+#\r
+\r
+from test import test_support\r
+from test import test_multibytecodec_support\r
+import unittest\r
+\r
+class Test_Big5HKSCS(test_multibytecodec_support.TestBase, unittest.TestCase):\r
+    encoding = 'big5hkscs'\r
+    tstring = test_multibytecodec_support.load_teststring('big5hkscs')\r
+    codectests = (\r
+        # invalid bytes\r
+        ("abc\x80\x80\xc1\xc4", "strict",  None),\r
+        ("abc\xc8", "strict",  None),\r
+        ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u8b10"),\r
+        ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u8b10\ufffd"),\r
+        ("abc\x80\x80\xc1\xc4", "ignore",  u"abc\u8b10"),\r
+    )\r
+\r
+def test_main():\r
+    test_support.run_unittest(__name__)\r
+\r
+if __name__ == "__main__":\r
+    test_main()\r