Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 1 | # |
| 2 | # test_codecencodings_tw.py |
| 3 | # Codec encoding tests for ROC encodings. |
| 4 | # |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 5 | |
R David Murray | 75d9aca | 2012-04-09 09:37:52 -0400 | [diff] [blame] | 6 | from test import multibytecodec_support |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 7 | import unittest |
| 8 | |
R David Murray | 75d9aca | 2012-04-09 09:37:52 -0400 | [diff] [blame] | 9 | class Test_Big5(multibytecodec_support.TestBase, unittest.TestCase): |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 10 | encoding = 'big5' |
R David Murray | 75d9aca | 2012-04-09 09:37:52 -0400 | [diff] [blame] | 11 | tstring = multibytecodec_support.load_teststring('big5') |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 12 | codectests = ( |
| 13 | # invalid bytes |
Guido van Rossum | 024da5c | 2007-05-17 23:59:11 +0000 | [diff] [blame] | 14 | (b"abc\x80\x80\xc1\xc4", "strict", None), |
| 15 | (b"abc\xc8", "strict", None), |
Victor Stinner | 2cded9c | 2011-07-08 01:45:13 +0200 | [diff] [blame] | 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"), |
Guido van Rossum | 024da5c | 2007-05-17 23:59:11 +0000 | [diff] [blame] | 18 | (b"abc\x80\x80\xc1\xc4", "ignore", "abc\u8b10"), |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 19 | ) |
| 20 | |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 21 | if __name__ == "__main__": |
Zachary Ware | 38c707e | 2015-04-13 15:00:43 -0500 | [diff] [blame] | 22 | unittest.main() |