blob: ccdc0b4c554460ee3ea7ace67606b379ce74f1b3 [file] [log] [blame]
Benjamin Peterson90f5ba52010-03-11 22:53:45 +00001#!/usr/bin/env python3
Hye-Shik Chang2bb146f2004-07-18 03:06:29 +00002#
3# test_codecencodings_hk.py
4# Codec encoding tests for HongKong encodings.
5#
Hye-Shik Chang2bb146f2004-07-18 03:06:29 +00006
Benjamin Petersonee8712c2008-05-20 21:35:26 +00007from test import support
Hye-Shik Chang2bb146f2004-07-18 03:06:29 +00008from test import test_multibytecodec_support
9import unittest
10
11class Test_Big5HKSCS(test_multibytecodec_support.TestBase, unittest.TestCase):
12 encoding = 'big5hkscs'
13 tstring = test_multibytecodec_support.load_teststring('big5hkscs')
14 codectests = (
15 # invalid bytes
Guido van Rossum024da5c2007-05-17 23:59:11 +000016 (b"abc\x80\x80\xc1\xc4", "strict", None),
17 (b"abc\xc8", "strict", None),
18 (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\u8b10"),
19 (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\u8b10\ufffd"),
20 (b"abc\x80\x80\xc1\xc4", "ignore", "abc\u8b10"),
Hye-Shik Chang2bb146f2004-07-18 03:06:29 +000021 )
22
23def test_main():
Benjamin Petersonee8712c2008-05-20 21:35:26 +000024 support.run_unittest(__name__)
Hye-Shik Chang2bb146f2004-07-18 03:06:29 +000025
26if __name__ == "__main__":
27 test_main()