ยปCore Development>Code coverage>Lib/test/test_codecmaps_jp.py

Python code coverage for Lib/test/test_codecmaps_jp.py

#countcontent
1n/a#
2n/a# test_codecmaps_jp.py
3n/a# Codec mapping tests for Japanese encodings
4n/a#
5n/a
6n/afrom test import multibytecodec_support
7n/aimport unittest
8n/a
9n/aclass TestCP932Map(multibytecodec_support.TestBase_Mapping,
10n/a unittest.TestCase):
11n/a encoding = 'cp932'
12n/a mapfileurl = 'http://www.pythontest.net/unicode/CP932.TXT'
13n/a supmaps = [
14n/a (b'\x80', '\u0080'),
15n/a (b'\xa0', '\uf8f0'),
16n/a (b'\xfd', '\uf8f1'),
17n/a (b'\xfe', '\uf8f2'),
18n/a (b'\xff', '\uf8f3'),
19n/a ]
20n/a for i in range(0xa1, 0xe0):
21n/a supmaps.append((bytes([i]), chr(i+0xfec0)))
22n/a
23n/a
24n/aclass TestEUCJPCOMPATMap(multibytecodec_support.TestBase_Mapping,
25n/a unittest.TestCase):
26n/a encoding = 'euc_jp'
27n/a mapfilename = 'EUC-JP.TXT'
28n/a mapfileurl = 'http://www.pythontest.net/unicode/EUC-JP.TXT'
29n/a
30n/a
31n/aclass TestSJISCOMPATMap(multibytecodec_support.TestBase_Mapping,
32n/a unittest.TestCase):
33n/a encoding = 'shift_jis'
34n/a mapfilename = 'SHIFTJIS.TXT'
35n/a mapfileurl = 'http://www.pythontest.net/unicode/SHIFTJIS.TXT'
36n/a pass_enctest = [
37n/a (b'\x81_', '\\'),
38n/a ]
39n/a pass_dectest = [
40n/a (b'\\', '\xa5'),
41n/a (b'~', '\u203e'),
42n/a (b'\x81_', '\\'),
43n/a ]
44n/a
45n/aclass TestEUCJISX0213Map(multibytecodec_support.TestBase_Mapping,
46n/a unittest.TestCase):
47n/a encoding = 'euc_jisx0213'
48n/a mapfilename = 'EUC-JISX0213.TXT'
49n/a mapfileurl = 'http://www.pythontest.net/unicode/EUC-JISX0213.TXT'
50n/a
51n/a
52n/aclass TestSJISX0213Map(multibytecodec_support.TestBase_Mapping,
53n/a unittest.TestCase):
54n/a encoding = 'shift_jisx0213'
55n/a mapfilename = 'SHIFT_JISX0213.TXT'
56n/a mapfileurl = 'http://www.pythontest.net/unicode/SHIFT_JISX0213.TXT'
57n/a
58n/a
59n/aif __name__ == "__main__":
60n/a unittest.main()