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