3
# test_codecencodings_kr.py
4
# Codec encoding tests for ROK encodings.
6
# $CJKCodecs: test_codecencodings_kr.py,v 1.2 2004/06/19 06:09:55 perky Exp $
8
from test import test_support
9
from test import test_multibytecodec_support
12
class Test_CP949(test_multibytecodec_support.TestBase, unittest.TestCase):
14
tstring = test_multibytecodec_support.load_teststring('cp949')
17
("abc\x80\x80\xc1\xc4", "strict", None),
18
("abc\xc8", "strict", None),
19
("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\uc894"),
20
("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\uc894\ufffd"),
21
("abc\x80\x80\xc1\xc4", "ignore", u"abc\uc894"),
24
class Test_EUCKR(test_multibytecodec_support.TestBase, unittest.TestCase):
26
tstring = test_multibytecodec_support.load_teststring('euc_kr')
29
("abc\x80\x80\xc1\xc4", "strict", None),
30
("abc\xc8", "strict", None),
31
("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\uc894"),
32
("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\uc894\ufffd"),
33
("abc\x80\x80\xc1\xc4", "ignore", u"abc\uc894"),
36
class Test_JOHAB(test_multibytecodec_support.TestBase, unittest.TestCase):
38
tstring = test_multibytecodec_support.load_teststring('johab')
41
("abc\x80\x80\xc1\xc4", "strict", None),
42
("abc\xc8", "strict", None),
43
("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\ucd27"),
44
("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\ucd27\ufffd"),
45
("abc\x80\x80\xc1\xc4", "ignore", u"abc\ucd27"),
49
suite = unittest.TestSuite()
50
suite.addTest(unittest.makeSuite(Test_CP949))
51
suite.addTest(unittest.makeSuite(Test_EUCKR))
52
suite.addTest(unittest.makeSuite(Test_JOHAB))
53
test_support.run_suite(suite)
55
if __name__ == "__main__":