Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / lib / python2.4 / test / test_codecencodings_hk.py
CommitLineData
920dae64
AT
1#!/usr/bin/env python
2#
3# test_codecencodings_hk.py
4# Codec encoding tests for HongKong encodings.
5#
6# $CJKCodecs: test_codecencodings_hk.py,v 1.1 2004/07/10 17:35:20 perky Exp $
7
8from test import test_support
9from test import test_multibytecodec_support
10import unittest
11
12class Test_Big5HKSCS(test_multibytecodec_support.TestBase, unittest.TestCase):
13 encoding = 'big5hkscs'
14 tstring = test_multibytecodec_support.load_teststring('big5hkscs')
15 codectests = (
16 # invalid bytes
17 ("abc\x80\x80\xc1\xc4", "strict", None),
18 ("abc\xc8", "strict", None),
19 ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u8b10"),
20 ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u8b10\ufffd"),
21 ("abc\x80\x80\xc1\xc4", "ignore", u"abc\u8b10"),
22 )
23
24def test_main():
25 suite = unittest.TestSuite()
26 suite.addTest(unittest.makeSuite(Test_Big5HKSCS))
27 test_support.run_suite(suite)
28
29if __name__ == "__main__":
30 test_main()