Staging
v0.8.1
Revision d01ae1b22330992eadc7b2a0842ead544f7e507d authored by Miss Islington (bot) on 03 February 2020, 17:17:17 UTC, committed by GitHub on 03 February 2020, 17:17:17 UTC
(cherry picked from commit 5807efd4c396d5718325e21f5a14e324a77ff77c)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
1 parent db2f311
Raw File
test_codecencodings_hk.py
#
# test_codecencodings_hk.py
#   Codec encoding tests for HongKong encodings.
#

from test import multibytecodec_support
import unittest

class Test_Big5HKSCS(multibytecodec_support.TestBase, unittest.TestCase):
    encoding = 'big5hkscs'
    tstring = multibytecodec_support.load_teststring('big5hkscs')
    codectests = (
        # invalid bytes
        (b"abc\x80\x80\xc1\xc4", "strict",  None),
        (b"abc\xc8", "strict",  None),
        (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\ufffd\u8b10"),
        (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\ufffd\u8b10\ufffd"),
        (b"abc\x80\x80\xc1\xc4", "ignore",  "abc\u8b10"),
    )

if __name__ == "__main__":
    unittest.main()
back to top