test_codecmaps_kr.py 1.19 KB
Newer Older
1 2 3 4 5
#
# test_codecmaps_kr.py
#   Codec mapping tests for ROK encodings
#

6
from test import support
7
from test import multibytecodec_support
8 9
import unittest

10
class TestCP949Map(multibytecodec_support.TestBase_Mapping,
11 12
                   unittest.TestCase):
    encoding = 'cp949'
13
    mapfileurl = 'http://www.pythontest.net/unicode/CP949.TXT'
14 15


16
class TestEUCKRMap(multibytecodec_support.TestBase_Mapping,
17 18
                   unittest.TestCase):
    encoding = 'euc_kr'
19
    mapfileurl = 'http://www.pythontest.net/unicode/EUC-KR.TXT'
20

21 22 23 24
    # A4D4 HANGUL FILLER indicates the begin of 8-bytes make-up sequence.
    pass_enctest = [(b'\xa4\xd4', '\u3164')]
    pass_dectest = [(b'\xa4\xd4', '\u3164')]

25

26
class TestJOHABMap(multibytecodec_support.TestBase_Mapping,
27 28
                   unittest.TestCase):
    encoding = 'johab'
29
    mapfileurl = 'http://www.pythontest.net/unicode/JOHAB.TXT'
30 31 32 33
    # KS X 1001 standard assigned 0x5c as WON SIGN.
    # but, in early 90s that is the only era used johab widely,
    # the most softwares implements it as REVERSE SOLIDUS.
    # So, we ignore the standard here.
34 35
    pass_enctest = [(b'\\', '\u20a9')]
    pass_dectest = [(b'\\', '\u20a9')]
36 37

if __name__ == "__main__":
38
    unittest.main()