/Lib/test/test_codecmaps_kr.py

http://unladen-swallow.googlecode.com/ · Python · 44 lines · 25 code · 9 blank · 10 comment · 1 complexity · d68fb43f5f797ca00aec2dcd4cd20b90 MD5 · raw file

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