Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | #!/usr/bin/env python |
2 | # | |
3 | # test_codecmaps_tw.py | |
4 | # Codec mapping tests for ROC encodings | |
5 | # | |
6 | # $CJKCodecs: test_codecmaps_tw.py,v 1.3 2004/06/19 06:09:55 perky Exp $ | |
7 | ||
8 | from test import test_support | |
9 | from test import test_multibytecodec_support | |
10 | import unittest | |
11 | ||
12 | class TestBIG5Map(test_multibytecodec_support.TestBase_Mapping, | |
13 | unittest.TestCase): | |
14 | encoding = 'big5' | |
15 | mapfilename = 'BIG5.TXT' | |
16 | mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/' \ | |
17 | 'EASTASIA/OTHER/BIG5.TXT' | |
18 | ||
19 | class TestCP950Map(test_multibytecodec_support.TestBase_Mapping, | |
20 | unittest.TestCase): | |
21 | encoding = 'cp950' | |
22 | mapfilename = 'CP950.TXT' | |
23 | mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/' \ | |
24 | 'WINDOWS/CP950.TXT' | |
25 | pass_enctest = [ | |
26 | ('\xa2\xcc', u'\u5341'), | |
27 | ('\xa2\xce', u'\u5345'), | |
28 | ] | |
29 | ||
30 | def test_main(): | |
31 | suite = unittest.TestSuite() | |
32 | suite.addTest(unittest.makeSuite(TestBIG5Map)) | |
33 | suite.addTest(unittest.makeSuite(TestCP950Map)) | |
34 | test_support.run_suite(suite) | |
35 | ||
36 | test_multibytecodec_support.register_skip_expected(TestBIG5Map, TestCP950Map) | |
37 | if __name__ == "__main__": | |
38 | test_main() |