Kaydet (Commit) c51a8e90 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka Kaydeden (comit) Victor Stinner

[2.7] Rename test_ file that is really a support file to remove test_ prefix. (#2548)

I thought I had run the full test suite before the last checkin, but
obviously I didn't.  test_multibytecodec_support.py isn't really a test file,
it is a support file that contains a base test class.  Rename it to
multibytecodec_support so that regrtest test discovery doesn't think it is a
test file that should be run..
(cherry picked from commit 75d9aca9)
üst d7955b81
# test_multibytecodec_support.py # multibytecodec_support.py
# Common Unittest Routines for CJK codecs # Common Unittest Routines for CJK codecs
# #
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_GB2312(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'gb2312' encoding = 'gb2312'
tstring = test_multibytecodec_support.load_teststring('gb2312') tstring = multibytecodec_support.load_teststring('gb2312')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x81\x81\xc1\xc4", "strict", None), ("abc\x81\x81\xc1\xc4", "strict", None),
...@@ -20,9 +20,9 @@ class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase): ...@@ -20,9 +20,9 @@ class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase):
("\xc1\x64", "strict", None), ("\xc1\x64", "strict", None),
) )
class Test_GBK(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_GBK(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'gbk' encoding = 'gbk'
tstring = test_multibytecodec_support.load_teststring('gbk') tstring = multibytecodec_support.load_teststring('gbk')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x80\x80\xc1\xc4", "strict", None), ("abc\x80\x80\xc1\xc4", "strict", None),
...@@ -34,9 +34,9 @@ class Test_GBK(test_multibytecodec_support.TestBase, unittest.TestCase): ...@@ -34,9 +34,9 @@ class Test_GBK(test_multibytecodec_support.TestBase, unittest.TestCase):
(u"\u30fb", "strict", None), (u"\u30fb", "strict", None),
) )
class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_GB18030(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'gb18030' encoding = 'gb18030'
tstring = test_multibytecodec_support.load_teststring('gb18030') tstring = multibytecodec_support.load_teststring('gb18030')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x80\x80\xc1\xc4", "strict", None), ("abc\x80\x80\xc1\xc4", "strict", None),
...@@ -55,9 +55,9 @@ class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase): ...@@ -55,9 +55,9 @@ class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase):
) )
has_iso10646 = True has_iso10646 = True
class Test_HZ(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_HZ(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'hz' encoding = 'hz'
tstring = test_multibytecodec_support.load_teststring('hz') tstring = multibytecodec_support.load_teststring('hz')
codectests = ( codectests = (
# test '~\n' (3 lines) # test '~\n' (3 lines)
(b'This sentence is in ASCII.\n' (b'This sentence is in ASCII.\n'
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class Test_Big5HKSCS(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_Big5HKSCS(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'big5hkscs' encoding = 'big5hkscs'
tstring = test_multibytecodec_support.load_teststring('big5hkscs') tstring = multibytecodec_support.load_teststring('big5hkscs')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x80\x80\xc1\xc4", "strict", None), ("abc\x80\x80\xc1\xc4", "strict", None),
......
# Codec encoding tests for ISO 2022 encodings. # Codec encoding tests for ISO 2022 encodings.
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
COMMON_CODEC_TESTS = ( COMMON_CODEC_TESTS = (
...@@ -11,23 +11,23 @@ COMMON_CODEC_TESTS = ( ...@@ -11,23 +11,23 @@ COMMON_CODEC_TESTS = (
(b'ab\x1B$def', 'replace', u'ab\uFFFD'), (b'ab\x1B$def', 'replace', u'ab\uFFFD'),
) )
class Test_ISO2022_JP(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_ISO2022_JP(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'iso2022_jp' encoding = 'iso2022_jp'
tstring = test_multibytecodec_support.load_teststring('iso2022_jp') tstring = multibytecodec_support.load_teststring('iso2022_jp')
codectests = COMMON_CODEC_TESTS + ( codectests = COMMON_CODEC_TESTS + (
(b'ab\x1BNdef', 'replace', u'ab\x1BNdef'), (b'ab\x1BNdef', 'replace', u'ab\x1BNdef'),
) )
class Test_ISO2022_JP2(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_ISO2022_JP2(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'iso2022_jp_2' encoding = 'iso2022_jp_2'
tstring = test_multibytecodec_support.load_teststring('iso2022_jp') tstring = multibytecodec_support.load_teststring('iso2022_jp')
codectests = COMMON_CODEC_TESTS + ( codectests = COMMON_CODEC_TESTS + (
(b'ab\x1BNdef', 'replace', u'abdef'), (b'ab\x1BNdef', 'replace', u'abdef'),
) )
class Test_ISO2022_KR(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_ISO2022_KR(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'iso2022_kr' encoding = 'iso2022_kr'
tstring = test_multibytecodec_support.load_teststring('iso2022_kr') tstring = multibytecodec_support.load_teststring('iso2022_kr')
codectests = COMMON_CODEC_TESTS + ( codectests = COMMON_CODEC_TESTS + (
(b'ab\x1BNdef', 'replace', u'ab\x1BNdef'), (b'ab\x1BNdef', 'replace', u'ab\x1BNdef'),
) )
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class Test_CP932(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_CP932(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'cp932' encoding = 'cp932'
tstring = test_multibytecodec_support.load_teststring('shift_jis') tstring = multibytecodec_support.load_teststring('shift_jis')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x81\x00\x81\x00\x82\x84", "strict", None), ("abc\x81\x00\x81\x00\x82\x84", "strict", None),
...@@ -22,10 +22,10 @@ class Test_CP932(test_multibytecodec_support.TestBase, unittest.TestCase): ...@@ -22,10 +22,10 @@ class Test_CP932(test_multibytecodec_support.TestBase, unittest.TestCase):
("\x81\x5f\x81\x61\x81\x7c", "replace", u"\uff3c\u2225\uff0d"), ("\x81\x5f\x81\x61\x81\x7c", "replace", u"\uff3c\u2225\uff0d"),
) )
class Test_EUC_JISX0213(test_multibytecodec_support.TestBase, class Test_EUC_JISX0213(multibytecodec_support.TestBase,
unittest.TestCase): unittest.TestCase):
encoding = 'euc_jisx0213' encoding = 'euc_jisx0213'
tstring = test_multibytecodec_support.load_teststring('euc_jisx0213') tstring = multibytecodec_support.load_teststring('euc_jisx0213')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x80\x80\xc1\xc4", "strict", None), ("abc\x80\x80\xc1\xc4", "strict", None),
...@@ -52,10 +52,10 @@ eucjp_commontests = ( ...@@ -52,10 +52,10 @@ eucjp_commontests = (
("\xc1\x64", "strict", None), ("\xc1\x64", "strict", None),
) )
class Test_EUC_JP_COMPAT(test_multibytecodec_support.TestBase, class Test_EUC_JP_COMPAT(multibytecodec_support.TestBase,
unittest.TestCase): unittest.TestCase):
encoding = 'euc_jp' encoding = 'euc_jp'
tstring = test_multibytecodec_support.load_teststring('euc_jp') tstring = multibytecodec_support.load_teststring('euc_jp')
codectests = eucjp_commontests + ( codectests = eucjp_commontests + (
("\xa1\xc0\\", "strict", u"\uff3c\\"), ("\xa1\xc0\\", "strict", u"\uff3c\\"),
(u"\xa5", "strict", "\x5c"), (u"\xa5", "strict", "\x5c"),
...@@ -70,17 +70,17 @@ shiftjis_commonenctests = ( ...@@ -70,17 +70,17 @@ shiftjis_commonenctests = (
("abc\x80\x80\x82\x84def", "ignore", u"abc\uff44def"), ("abc\x80\x80\x82\x84def", "ignore", u"abc\uff44def"),
) )
class Test_SJIS_COMPAT(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_SJIS_COMPAT(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'shift_jis' encoding = 'shift_jis'
tstring = test_multibytecodec_support.load_teststring('shift_jis') tstring = multibytecodec_support.load_teststring('shift_jis')
codectests = shiftjis_commonenctests + ( codectests = shiftjis_commonenctests + (
("\\\x7e", "strict", u"\\\x7e"), ("\\\x7e", "strict", u"\\\x7e"),
("\x81\x5f\x81\x61\x81\x7c", "strict", u"\uff3c\u2016\u2212"), ("\x81\x5f\x81\x61\x81\x7c", "strict", u"\uff3c\u2016\u2212"),
) )
class Test_SJISX0213(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_SJISX0213(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'shift_jisx0213' encoding = 'shift_jisx0213'
tstring = test_multibytecodec_support.load_teststring('shift_jisx0213') tstring = multibytecodec_support.load_teststring('shift_jisx0213')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x80\x80\x82\x84", "strict", None), ("abc\x80\x80\x82\x84", "strict", None),
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class Test_CP949(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_CP949(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'cp949' encoding = 'cp949'
tstring = test_multibytecodec_support.load_teststring('cp949') tstring = multibytecodec_support.load_teststring('cp949')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x80\x80\xc1\xc4", "strict", None), ("abc\x80\x80\xc1\xc4", "strict", None),
...@@ -19,9 +19,9 @@ class Test_CP949(test_multibytecodec_support.TestBase, unittest.TestCase): ...@@ -19,9 +19,9 @@ class Test_CP949(test_multibytecodec_support.TestBase, unittest.TestCase):
("abc\x80\x80\xc1\xc4", "ignore", u"abc\uc894"), ("abc\x80\x80\xc1\xc4", "ignore", u"abc\uc894"),
) )
class Test_EUCKR(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_EUCKR(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'euc_kr' encoding = 'euc_kr'
tstring = test_multibytecodec_support.load_teststring('euc_kr') tstring = multibytecodec_support.load_teststring('euc_kr')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x80\x80\xc1\xc4", "strict", None), ("abc\x80\x80\xc1\xc4", "strict", None),
...@@ -49,9 +49,9 @@ class Test_EUCKR(test_multibytecodec_support.TestBase, unittest.TestCase): ...@@ -49,9 +49,9 @@ class Test_EUCKR(test_multibytecodec_support.TestBase, unittest.TestCase):
("\xc1\xc4", "strict", u"\uc894"), ("\xc1\xc4", "strict", u"\uc894"),
) )
class Test_JOHAB(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_JOHAB(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'johab' encoding = 'johab'
tstring = test_multibytecodec_support.load_teststring('johab') tstring = multibytecodec_support.load_teststring('johab')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x80\x80\xc1\xc4", "strict", None), ("abc\x80\x80\xc1\xc4", "strict", None),
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class Test_Big5(test_multibytecodec_support.TestBase, unittest.TestCase): class Test_Big5(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'big5' encoding = 'big5'
tstring = test_multibytecodec_support.load_teststring('big5') tstring = multibytecodec_support.load_teststring('big5')
codectests = ( codectests = (
# invalid bytes # invalid bytes
("abc\x80\x80\xc1\xc4", "strict", None), ("abc\x80\x80\xc1\xc4", "strict", None),
......
...@@ -4,20 +4,20 @@ ...@@ -4,20 +4,20 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping, class TestGB2312Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'gb2312' encoding = 'gb2312'
mapfileurl = 'http://www.pythontest.net/unicode/EUC-CN.TXT' mapfileurl = 'http://www.pythontest.net/unicode/EUC-CN.TXT'
class TestGBKMap(test_multibytecodec_support.TestBase_Mapping, class TestGBKMap(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'gbk' encoding = 'gbk'
mapfileurl = 'http://www.pythontest.net/unicode/CP936.TXT' mapfileurl = 'http://www.pythontest.net/unicode/CP936.TXT'
class TestGB18030Map(test_multibytecodec_support.TestBase_Mapping, class TestGB18030Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'gb18030' encoding = 'gb18030'
mapfileurl = 'http://www.pythontest.net/unicode/gb-18030-2000.xml' mapfileurl = 'http://www.pythontest.net/unicode/gb-18030-2000.xml'
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class TestBig5HKSCSMap(test_multibytecodec_support.TestBase_Mapping, class TestBig5HKSCSMap(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'big5hkscs' encoding = 'big5hkscs'
mapfileurl = 'http://www.pythontest.net/unicode/BIG5HKSCS-2004.TXT' mapfileurl = 'http://www.pythontest.net/unicode/BIG5HKSCS-2004.TXT'
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class TestCP932Map(test_multibytecodec_support.TestBase_Mapping, class TestCP932Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'cp932' encoding = 'cp932'
mapfileurl = 'http://www.pythontest.net/unicode/CP932.TXT' mapfileurl = 'http://www.pythontest.net/unicode/CP932.TXT'
...@@ -22,14 +22,14 @@ class TestCP932Map(test_multibytecodec_support.TestBase_Mapping, ...@@ -22,14 +22,14 @@ class TestCP932Map(test_multibytecodec_support.TestBase_Mapping,
supmaps.append((chr(i), unichr(i+0xfec0))) supmaps.append((chr(i), unichr(i+0xfec0)))
class TestEUCJPCOMPATMap(test_multibytecodec_support.TestBase_Mapping, class TestEUCJPCOMPATMap(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'euc_jp' encoding = 'euc_jp'
mapfilename = 'EUC-JP.TXT' mapfilename = 'EUC-JP.TXT'
mapfileurl = 'http://www.pythontest.net/unicode/EUC-JP.TXT' mapfileurl = 'http://www.pythontest.net/unicode/EUC-JP.TXT'
class TestSJISCOMPATMap(test_multibytecodec_support.TestBase_Mapping, class TestSJISCOMPATMap(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'shift_jis' encoding = 'shift_jis'
mapfilename = 'SHIFTJIS.TXT' mapfilename = 'SHIFTJIS.TXT'
...@@ -43,14 +43,14 @@ class TestSJISCOMPATMap(test_multibytecodec_support.TestBase_Mapping, ...@@ -43,14 +43,14 @@ class TestSJISCOMPATMap(test_multibytecodec_support.TestBase_Mapping,
('\x81_', u'\\'), ('\x81_', u'\\'),
] ]
class TestEUCJISX0213Map(test_multibytecodec_support.TestBase_Mapping, class TestEUCJISX0213Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'euc_jisx0213' encoding = 'euc_jisx0213'
mapfilename = 'EUC-JISX0213.TXT' mapfilename = 'EUC-JISX0213.TXT'
mapfileurl = 'http://www.pythontest.net/unicode/EUC-JISX0213.TXT' mapfileurl = 'http://www.pythontest.net/unicode/EUC-JISX0213.TXT'
class TestSJISX0213Map(test_multibytecodec_support.TestBase_Mapping, class TestSJISX0213Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'shift_jisx0213' encoding = 'shift_jisx0213'
mapfilename = 'SHIFT_JISX0213.TXT' mapfilename = 'SHIFT_JISX0213.TXT'
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class TestCP949Map(test_multibytecodec_support.TestBase_Mapping, class TestCP949Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'cp949' encoding = 'cp949'
mapfileurl = 'http://www.pythontest.net/unicode/CP949.TXT' mapfileurl = 'http://www.pythontest.net/unicode/CP949.TXT'
class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, class TestEUCKRMap(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'euc_kr' encoding = 'euc_kr'
mapfileurl = 'http://www.pythontest.net/unicode/EUC-KR.TXT' mapfileurl = 'http://www.pythontest.net/unicode/EUC-KR.TXT'
...@@ -23,7 +23,7 @@ class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, ...@@ -23,7 +23,7 @@ class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping,
pass_dectest = [('\xa4\xd4', u'\u3164')] pass_dectest = [('\xa4\xd4', u'\u3164')]
class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping, class TestJOHABMap(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'johab' encoding = 'johab'
mapfileurl = 'http://www.pythontest.net/unicode/JOHAB.TXT' mapfileurl = 'http://www.pythontest.net/unicode/JOHAB.TXT'
......
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
# #
from test import test_support from test import test_support
from test import test_multibytecodec_support from test import multibytecodec_support
import unittest import unittest
class TestBIG5Map(test_multibytecodec_support.TestBase_Mapping, class TestBIG5Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'big5' encoding = 'big5'
mapfileurl = 'http://www.pythontest.net/unicode/BIG5.TXT' mapfileurl = 'http://www.pythontest.net/unicode/BIG5.TXT'
class TestCP950Map(test_multibytecodec_support.TestBase_Mapping, class TestCP950Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase): unittest.TestCase):
encoding = 'cp950' encoding = 'cp950'
mapfileurl = 'http://www.pythontest.net/unicode/CP950.TXT' mapfileurl = 'http://www.pythontest.net/unicode/CP950.TXT'
......
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