test_codecencodings_tw.py 706 Bytes
Newer Older
1 2 3 4 5
#
# test_codecencodings_tw.py
#   Codec encoding tests for ROC encodings.
#

6
from test import support
7
from test import multibytecodec_support
8 9
import unittest

10
class Test_Big5(multibytecodec_support.TestBase, unittest.TestCase):
11
    encoding = 'big5'
12
    tstring = multibytecodec_support.load_teststring('big5')
13 14
    codectests = (
        # invalid bytes
15 16
        (b"abc\x80\x80\xc1\xc4", "strict",  None),
        (b"abc\xc8", "strict",  None),
17 18
        (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\ufffd\u8b10"),
        (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\ufffd\u8b10\ufffd"),
19
        (b"abc\x80\x80\xc1\xc4", "ignore",  "abc\u8b10"),
20 21 22
    )

if __name__ == "__main__":
23
    unittest.main()