test_codecmaps_kr.py 1.2 KB

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