Replaced my dumb way of calculating seconds to midnight with Tim Peters' much more...
[python.git] / Lib / test / test_codecencodings_hk.py
blob1cd020fc353683000a2675dde126642b1ad8f1df
1 #!/usr/bin/env python
3 # test_codecencodings_hk.py
4 # Codec encoding tests for HongKong encodings.
7 from test import test_support
8 from test import test_multibytecodec_support
9 import unittest
11 class Test_Big5HKSCS(test_multibytecodec_support.TestBase, unittest.TestCase):
12 encoding = 'big5hkscs'
13 tstring = test_multibytecodec_support.load_teststring('big5hkscs')
14 codectests = (
15 # invalid bytes
16 ("abc\x80\x80\xc1\xc4", "strict", None),
17 ("abc\xc8", "strict", None),
18 ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u8b10"),
19 ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u8b10\ufffd"),
20 ("abc\x80\x80\xc1\xc4", "ignore", u"abc\u8b10"),
23 def test_main():
24 suite = unittest.TestSuite()
25 suite.addTest(unittest.makeSuite(Test_Big5HKSCS))
26 test_support.run_suite(suite)
28 if __name__ == "__main__":
29 test_main()