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