2004-01-17 10:29:29 -04:00
|
|
|
#
|
|
|
|
# test_codecmaps_tw.py
|
|
|
|
# Codec mapping tests for ROC encodings
|
|
|
|
#
|
|
|
|
|
2008-05-20 18:35:26 -03:00
|
|
|
from test import support
|
2012-04-09 10:37:52 -03:00
|
|
|
from test import multibytecodec_support
|
2004-01-17 10:29:29 -04:00
|
|
|
import unittest
|
|
|
|
|
2012-04-09 10:37:52 -03:00
|
|
|
class TestBIG5Map(multibytecodec_support.TestBase_Mapping,
|
2004-01-17 10:29:29 -04:00
|
|
|
unittest.TestCase):
|
|
|
|
encoding = 'big5'
|
|
|
|
mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/' \
|
|
|
|
'EASTASIA/OTHER/BIG5.TXT'
|
|
|
|
|
2012-04-09 10:37:52 -03:00
|
|
|
class TestCP950Map(multibytecodec_support.TestBase_Mapping,
|
2004-01-17 10:29:29 -04:00
|
|
|
unittest.TestCase):
|
|
|
|
encoding = 'cp950'
|
|
|
|
mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/' \
|
|
|
|
'WINDOWS/CP950.TXT'
|
|
|
|
pass_enctest = [
|
2007-07-23 15:06:59 -03:00
|
|
|
(b'\xa2\xcc', '\u5341'),
|
|
|
|
(b'\xa2\xce', '\u5345'),
|
2004-01-17 10:29:29 -04:00
|
|
|
]
|
2011-07-07 20:45:13 -03:00
|
|
|
codectests = (
|
|
|
|
(b"\xFFxy", "replace", "\ufffdxy"),
|
|
|
|
)
|
2004-01-17 10:29:29 -04:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2014-07-01 21:55:04 -03:00
|
|
|
unittest.main()
|