PyXR

c:\python24\lib \ test \ test_codecencodings_hk.py



0001 #!/usr/bin/env python
0002 #
0003 # test_codecencodings_hk.py
0004 #   Codec encoding tests for HongKong encodings.
0005 #
0006 # $CJKCodecs: test_codecencodings_hk.py,v 1.1 2004/07/10 17:35:20 perky Exp $
0007 
0008 from test import test_support
0009 from test import test_multibytecodec_support
0010 import unittest
0011 
0012 class Test_Big5HKSCS(test_multibytecodec_support.TestBase, unittest.TestCase):
0013     encoding = 'big5hkscs'
0014     tstring = test_multibytecodec_support.load_teststring('big5hkscs')
0015     codectests = (
0016         # invalid bytes
0017         ("abc\x80\x80\xc1\xc4", "strict",  None),
0018         ("abc\xc8", "strict",  None),
0019         ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u8b10"),
0020         ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u8b10\ufffd"),
0021         ("abc\x80\x80\xc1\xc4", "ignore",  u"abc\u8b10"),
0022     )
0023 
0024 def test_main():
0025     suite = unittest.TestSuite()
0026     suite.addTest(unittest.makeSuite(Test_Big5HKSCS))
0027     test_support.run_suite(suite)
0028 
0029 if __name__ == "__main__":
0030     test_main()
0031 

Generated by PyXR 0.9.4
SourceForge.net Logo