Staging
v0.8.1
v0.8.1
swh:1:snp:635f4099902912592851108bcac178ff574f7c5f
Tip revision: 076ca6c3c8df3030307e548d9be792ce3c1c6eea authored by Martin Panter on 14 July 2016, 01:31:46 UTC
Issue #27369: Don’t test error message detail that changed in Expat 2.2.0
Issue #27369: Don’t test error message detail that changed in Expat 2.2.0
Tip revision: 076ca6c
test_codecencodings_iso2022.py
#!/usr/bin/env python
#
# Codec encoding tests for ISO 2022 encodings.
from test import support
from test import test_multibytecodec_support
import unittest
COMMON_CODEC_TESTS = (
# invalid bytes
(b'ab\xFFcd', 'replace', 'ab\uFFFDcd'),
(b'ab\x1Bdef', 'replace', 'ab\x1Bdef'),
(b'ab\x1B$def', 'replace', 'ab\uFFFD'),
)
class Test_ISO2022_JP(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'iso2022_jp'
tstring = test_multibytecodec_support.load_teststring('iso2022_jp')
codectests = COMMON_CODEC_TESTS + (
(b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
)
class Test_ISO2022_JP2(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'iso2022_jp_2'
tstring = test_multibytecodec_support.load_teststring('iso2022_jp')
codectests = COMMON_CODEC_TESTS + (
(b'ab\x1BNdef', 'replace', 'abdef'),
)
class Test_ISO2022_KR(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'iso2022_kr'
tstring = test_multibytecodec_support.load_teststring('iso2022_kr')
codectests = COMMON_CODEC_TESTS + (
(b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
)
# iso2022_kr.txt cannot be used to test "chunk coding": the escape
# sequence is only written on the first line
def test_chunkcoding(self):
pass
def test_main():
support.run_unittest(__name__)
if __name__ == "__main__":
test_main()