Commit 6246f2a1 authored by Georg Brandl's avatar Georg Brandl

#22650: test suite: load Unicode test data files from www.pythontest.net

parent a1137fba
...@@ -10,19 +10,17 @@ import unittest ...@@ -10,19 +10,17 @@ import unittest
class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping, class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'gb2312' encoding = 'gb2312'
mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-CN.TXT' mapfileurl = 'http://www.pythontest.net/unicode/EUC-CN.TXT'
class TestGBKMap(test_multibytecodec_support.TestBase_Mapping, class TestGBKMap(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'gbk' encoding = 'gbk'
mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/' \ mapfileurl = 'http://www.pythontest.net/unicode/CP936.TXT'
'MICSFT/WINDOWS/CP936.TXT'
class TestGB18030Map(test_multibytecodec_support.TestBase_Mapping, class TestGB18030Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'gb18030' encoding = 'gb18030'
mapfileurl = 'http://source.icu-project.org/repos/icu/data/' \ mapfileurl = 'http://www.pythontest.net/unicode/gb-18030-2000.xml'
'trunk/charset/data/xml/gb-18030-2000.xml'
def test_main(): def test_main():
......
...@@ -10,7 +10,7 @@ import unittest ...@@ -10,7 +10,7 @@ import unittest
class TestBig5HKSCSMap(test_multibytecodec_support.TestBase_Mapping, class TestBig5HKSCSMap(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'big5hkscs' encoding = 'big5hkscs'
mapfileurl = 'http://people.freebsd.org/~perky/i18n/BIG5HKSCS-2004.TXT' mapfileurl = 'http://www.pythontest.net/unicode/BIG5HKSCS-2004.TXT'
def test_main(): def test_main():
test_support.run_unittest(__name__) test_support.run_unittest(__name__)
......
...@@ -10,8 +10,7 @@ import unittest ...@@ -10,8 +10,7 @@ import unittest
class TestCP932Map(test_multibytecodec_support.TestBase_Mapping, class TestCP932Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'cp932' encoding = 'cp932'
mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/' \ mapfileurl = 'http://www.pythontest.net/unicode/CP932.TXT'
'WINDOWS/CP932.TXT'
supmaps = [ supmaps = [
('\x80', u'\u0080'), ('\x80', u'\u0080'),
('\xa0', u'\uf8f0'), ('\xa0', u'\uf8f0'),
...@@ -27,15 +26,14 @@ class TestEUCJPCOMPATMap(test_multibytecodec_support.TestBase_Mapping, ...@@ -27,15 +26,14 @@ class TestEUCJPCOMPATMap(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'euc_jp' encoding = 'euc_jp'
mapfilename = 'EUC-JP.TXT' mapfilename = 'EUC-JP.TXT'
mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-JP.TXT' mapfileurl = 'http://www.pythontest.net/unicode/EUC-JP.TXT'
class TestSJISCOMPATMap(test_multibytecodec_support.TestBase_Mapping, class TestSJISCOMPATMap(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'shift_jis' encoding = 'shift_jis'
mapfilename = 'SHIFTJIS.TXT' mapfilename = 'SHIFTJIS.TXT'
mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE' \ mapfileurl = 'http://www.pythontest.net/unicode/SHIFTJIS.TXT'
'/EASTASIA/JIS/SHIFTJIS.TXT'
pass_enctest = [ pass_enctest = [
('\x81_', u'\\'), ('\x81_', u'\\'),
] ]
...@@ -49,14 +47,14 @@ class TestEUCJISX0213Map(test_multibytecodec_support.TestBase_Mapping, ...@@ -49,14 +47,14 @@ class TestEUCJISX0213Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'euc_jisx0213' encoding = 'euc_jisx0213'
mapfilename = 'EUC-JISX0213.TXT' mapfilename = 'EUC-JISX0213.TXT'
mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-JISX0213.TXT' mapfileurl = 'http://www.pythontest.net/unicode/EUC-JISX0213.TXT'
class TestSJISX0213Map(test_multibytecodec_support.TestBase_Mapping, class TestSJISX0213Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'shift_jisx0213' encoding = 'shift_jisx0213'
mapfilename = 'SHIFT_JISX0213.TXT' mapfilename = 'SHIFT_JISX0213.TXT'
mapfileurl = 'http://people.freebsd.org/~perky/i18n/SHIFT_JISX0213.TXT' mapfileurl = 'http://www.pythontest.net/unicode/SHIFT_JISX0213.TXT'
def test_main(): def test_main():
......
...@@ -10,14 +10,13 @@ import unittest ...@@ -10,14 +10,13 @@ import unittest
class TestCP949Map(test_multibytecodec_support.TestBase_Mapping, class TestCP949Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'cp949' encoding = 'cp949'
mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT' \ mapfileurl = 'http://www.pythontest.net/unicode/CP949.TXT'
'/WINDOWS/CP949.TXT'
class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'euc_kr' encoding = 'euc_kr'
mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-KR.TXT' mapfileurl = 'http://www.pythontest.net/unicode/EUC-KR.TXT'
# A4D4 HANGUL FILLER indicates the begin of 8-bytes make-up sequence. # A4D4 HANGUL FILLER indicates the begin of 8-bytes make-up sequence.
pass_enctest = [('\xa4\xd4', u'\u3164')] pass_enctest = [('\xa4\xd4', u'\u3164')]
...@@ -27,8 +26,7 @@ class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, ...@@ -27,8 +26,7 @@ class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping,
class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping, class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'johab' encoding = 'johab'
mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/' \ mapfileurl = 'http://www.pythontest.net/unicode/JOHAB.TXT'
'KSC/JOHAB.TXT'
# KS X 1001 standard assigned 0x5c as WON SIGN. # KS X 1001 standard assigned 0x5c as WON SIGN.
# but, in early 90s that is the only era used johab widely, # but, in early 90s that is the only era used johab widely,
# the most softwares implements it as REVERSE SOLIDUS. # the most softwares implements it as REVERSE SOLIDUS.
......
...@@ -10,14 +10,12 @@ import unittest ...@@ -10,14 +10,12 @@ import unittest
class TestBIG5Map(test_multibytecodec_support.TestBase_Mapping, class TestBIG5Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'big5' encoding = 'big5'
mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/' \ mapfileurl = 'http://www.pythontest.net/unicode/BIG5.TXT'
'EASTASIA/OTHER/BIG5.TXT'
class TestCP950Map(test_multibytecodec_support.TestBase_Mapping, class TestCP950Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'cp950' encoding = 'cp950'
mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/' \ mapfileurl = 'http://www.pythontest.net/unicode/CP950.TXT'
'WINDOWS/CP950.TXT'
pass_enctest = [ pass_enctest = [
('\xa2\xcc', u'\u5341'), ('\xa2\xcc', u'\u5341'),
('\xa2\xce', u'\u5345'), ('\xa2\xce', u'\u5345'),
......
...@@ -7,7 +7,7 @@ import os ...@@ -7,7 +7,7 @@ import os
from unicodedata import normalize, unidata_version from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest.txt" TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE TESTDATAURL = "http://www.pythontest.net/unicode/" + unidata_version + "/" + TESTDATAFILE
def check_version(testfile): def check_version(testfile):
hdr = testfile.readline() hdr = testfile.readline()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment