1#!/usr/bin/env python 2# 3# test_codecmaps_kr.py 4# Codec mapping tests for ROK encodings 5# 6 7from test import test_support 8from test import test_multibytecodec_support 9import unittest 10 11class TestCP949Map(test_multibytecodec_support.TestBase_Mapping, 12 unittest.TestCase): 13 encoding = 'cp949' 14 mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT' \ 15 '/WINDOWS/CP949.TXT' 16 17 18class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, 19 unittest.TestCase): 20 encoding = 'euc_kr' 21 mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-KR.TXT' 22 23 # A4D4 HANGUL FILLER indicates the begin of 8-bytes make-up sequence. 24 pass_enctest = [('\xa4\xd4', u'\u3164')] 25 pass_dectest = [('\xa4\xd4', u'\u3164')] 26 27 28class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping, 29 unittest.TestCase): 30 encoding = 'johab' 31 mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/' \ 32 'KSC/JOHAB.TXT' 33 # KS X 1001 standard assigned 0x5c as WON SIGN. 34 # but, in early 90s that is the only era used johab widely, 35 # the most softwares implements it as REVERSE SOLIDUS. 36 # So, we ignore the standard here. 37 pass_enctest = [('\\', u'\u20a9')] 38 pass_dectest = [('\\', u'\u20a9')] 39 40def test_main(): 41 test_support.run_unittest(__name__) 42 43if __name__ == "__main__": 44 test_main() 45