1 # 2 # test_codecencodings_hk.py 3 # Codec encoding tests for HongKong encodings. 4 # 5 6 from test import multibytecodec_support 7 import unittest 8 9 class Test_Big5HKSCS(multibytecodec_support.TestBase, unittest.TestCase): 10 encoding = 'big5hkscs' 11 tstring = multibytecodec_support.load_teststring('big5hkscs') 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 21 if __name__ == "__main__": 22 unittest.main() 23