# $Id: test_codecmaps_tw.py,v 1.3 2004/06/19 06:09:55 perky Exp $

from test import test_support
import test_multibytecodec_support
import unittest


class TestBIG5Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase):
    encoding = "cjkcodecs.big5"
    mapfilename = "BIG5.TXT"
    mapfileurl = "http://www.unicode.org/Public/MAPPINGS/OBSOLETE/" "EASTASIA/OTHER/BIG5.TXT"


class TestCP950Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase):
    encoding = "cjkcodecs.cp950"
    mapfilename = "CP950.TXT"
    mapfileurl = "http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/" "WINDOWS/CP950.TXT"
    pass_enctest = [("\xa2\xcc", u"\u5341"), ("\xa2\xce", u"\u5345")]


def test_main():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestBIG5Map))
    suite.addTest(unittest.makeSuite(TestCP950Map))
    test_support.run_suite(suite)


test_multibytecodec_support.register_skip_expected(TestBIG5Map, TestCP950Map)
if __name__ == "__main__":
    test_main()
class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase):
    encoding = "cjkcodecs.euc_kr"
    mapfilename = "EUC-KR.TXT"
    mapfileurl = "http://people.freebsd.org/~perky/i18n/EUC-KR.TXT"


class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase):
    encoding = "cjkcodecs.johab"
    mapfilename = "JOHAB.TXT"
    mapfileurl = "http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/" "KSC/JOHAB.TXT"
    # 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.
    pass_enctest = [("\\", u"\u20a9")]
    pass_dectest = [("\\", u"\u20a9")]


def test_main():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestCP949Map))
    suite.addTest(unittest.makeSuite(TestEUCKRMap))
    suite.addTest(unittest.makeSuite(TestJOHABMap))
    test_support.run_suite(suite)


test_multibytecodec_support.register_skip_expected(TestCP949Map, TestEUCKRMap, TestJOHABMap)
if __name__ == "__main__":
    test_main()
#!/usr/bin/env python
#
# test_codecmaps_hk.py
#   Codec mapping tests for HongKong encodings
#
# $Id: test_codecmaps_hk.py,v 1.1 2004/07/10 17:35:20 perky Exp $

from test import test_support
import test_multibytecodec_support
import unittest

class TestBig5HKSCSMap(test_multibytecodec_support.TestBase_Mapping,
                       unittest.TestCase):
    encoding = 'cjkcodecs.big5hkscs'
    mapfilename = 'BIG5HKSCS.TXT'
    mapfileurl = 'http://people.freebsd.org/~perky/i18n/BIG5HKSCS.TXT'

def test_main():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestBig5HKSCSMap))
    test_support.run_suite(suite)

test_multibytecodec_support.register_skip_expected(TestBig5HKSCSMap)
if __name__ == "__main__":
    test_main()
class TestEUCJISX0213Map(test_multibytecodec_support.TestBase_Mapping,
                         unittest.TestCase):
    encoding = 'cjkcodecs.euc_jisx0213'
    mapfilename = 'EUC-JISX0213.TXT'
    mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-JISX0213.TXT'


class TestSJISX0213Map(test_multibytecodec_support.TestBase_Mapping,
                       unittest.TestCase):
    encoding = 'cjkcodecs.shift_jisx0213'
    mapfilename = 'SHIFT_JISX0213.TXT'
    mapfileurl = 'http://people.freebsd.org/~perky/i18n/SHIFT_JISX0213.TXT'


def test_main():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestCP932Map))
    suite.addTest(unittest.makeSuite(TestEUCJPCOMPATMap))
    suite.addTest(unittest.makeSuite(TestSJISCOMPATMap))
    suite.addTest(unittest.makeSuite(TestEUCJISX0213Map))
    suite.addTest(unittest.makeSuite(TestSJISX0213Map))
    test_support.run_suite(suite)

test_multibytecodec_support.register_skip_expected(TestCP932Map,
    TestEUCJPCOMPATMap, TestSJISCOMPATMap, TestEUCJISX0213Map,
    TestSJISX0213Map)

if __name__ == "__main__":
    test_main()