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

Python code coverage for Lib/test/test_codecencodings_iso2022.py

#countcontent
1n/a# Codec encoding tests for ISO 2022 encodings.
2n/a
3n/afrom test import multibytecodec_support
4n/aimport unittest
5n/a
6n/aCOMMON_CODEC_TESTS = (
7n/a # invalid bytes
8n/a (b'ab\xFFcd', 'replace', 'ab\uFFFDcd'),
9n/a (b'ab\x1Bdef', 'replace', 'ab\x1Bdef'),
10n/a (b'ab\x1B$def', 'replace', 'ab\uFFFD'),
11n/a )
12n/a
13n/aclass Test_ISO2022_JP(multibytecodec_support.TestBase, unittest.TestCase):
14n/a encoding = 'iso2022_jp'
15n/a tstring = multibytecodec_support.load_teststring('iso2022_jp')
16n/a codectests = COMMON_CODEC_TESTS + (
17n/a (b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
18n/a )
19n/a
20n/aclass Test_ISO2022_JP2(multibytecodec_support.TestBase, unittest.TestCase):
21n/a encoding = 'iso2022_jp_2'
22n/a tstring = multibytecodec_support.load_teststring('iso2022_jp')
23n/a codectests = COMMON_CODEC_TESTS + (
24n/a (b'ab\x1BNdef', 'replace', 'abdef'),
25n/a )
26n/a
27n/aclass Test_ISO2022_KR(multibytecodec_support.TestBase, unittest.TestCase):
28n/a encoding = 'iso2022_kr'
29n/a tstring = multibytecodec_support.load_teststring('iso2022_kr')
30n/a codectests = COMMON_CODEC_TESTS + (
31n/a (b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
32n/a )
33n/a
34n/a # iso2022_kr.txt cannot be used to test "chunk coding": the escape
35n/a # sequence is only written on the first line
36n/a @unittest.skip('iso2022_kr.txt cannot be used to test "chunk coding"')
37n/a def test_chunkcoding(self):
38n/a pass
39n/a
40n/aif __name__ == "__main__":
41n/a unittest.main()