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