1# 2# test_codecencodings_tw.py 3# Codec encoding tests for ROC encodings. 4# 5 6from test import multibytecodec_support 7import unittest 8 9class Test_Big5(multibytecodec_support.TestBase, unittest.TestCase): 10 encoding = 'big5' 11 tstring = multibytecodec_support.load_teststring('big5') 12 codectests = ( 13 # invalid bytes 14 (b"abc\x80\x80\xc1\xc4", "strict", None), 15 (b"abc\xc8", "strict", None), 16 (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\ufffd\u8b10"), 17 (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\ufffd\u8b10\ufffd"), 18 (b"abc\x80\x80\xc1\xc4", "ignore", "abc\u8b10"), 19 ) 20 21if __name__ == "__main__": 22 unittest.main() 23