/Lib/test/test_codecmaps_cn.py

http://unladen-swallow.googlecode.com/ · Python · 33 lines · 21 code · 7 blank · 5 comment · 1 complexity · 92c02ca7f7b573b35e2b78d71dbf7fce MD5 · raw file

  1. #!/usr/bin/env python
  2. #
  3. # test_codecmaps_cn.py
  4. # Codec mapping tests for PRC encodings
  5. #
  6. from test import test_support
  7. from test import test_multibytecodec_support
  8. import unittest
  9. class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping,
  10. unittest.TestCase):
  11. encoding = 'gb2312'
  12. mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-CN.TXT'
  13. class TestGBKMap(test_multibytecodec_support.TestBase_Mapping,
  14. unittest.TestCase):
  15. encoding = 'gbk'
  16. mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/' \
  17. 'MICSFT/WINDOWS/CP936.TXT'
  18. class TestGB18030Map(test_multibytecodec_support.TestBase_Mapping,
  19. unittest.TestCase):
  20. encoding = 'gb18030'
  21. mapfileurl = 'http://source.icu-project.org/repos/icu/data/' \
  22. 'trunk/charset/data/xml/gb-18030-2000.xml'
  23. def test_main():
  24. test_support.run_unittest(__name__)
  25. if __name__ == "__main__":
  26. test_main()