[KoCo-CVS] [Commit] cjkcodecs/tests test_mapping_cp932.py test_mapping_cp949.py test_mapping_cp950.p
Brought to you by:
perky
perky 03/05/28 01:02:08 Modified: tests test_mapping_cp932.py test_mapping_cp949.py test_mapping_cp950.py test_mapping_euc_jp.py test_mapping_euc_kr.py test_mapping_gb2312.py test_mapping_gbk.py test_mapping_shift_jis.py testall.py Log: Collect all test suits and run at once. Revision Changes Path 1.2 +6 -6 cjkcodecs/tests/test_mapping_cp932.py Index: test_mapping_cp932.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_cp932.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_mapping_cp932.py 26 May 2003 11:10:50 -0000 1.1 +++ test_mapping_cp932.py 28 May 2003 08:02:06 -0000 1.2 @@ -27,24 +27,24 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_cp932.py,v 1.1 2003/05/26 11:10:50 perky Exp $ +# $Id: test_mapping_cp932.py,v 1.2 2003/05/28 08:02:06 perky Exp $ # from test import test_support import test_multibytecodec_support import os, unittest +if not os.path.exists('CP932.TXT'): + raise test_support.TestSkipped( + 'CP932.TXT not found, download from http://www.unicode.' + 'org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP932.TXT') + class TestCP932Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp932' mapfilename = 'CP932.TXT' def test_main(): - if not os.path.exists('CP932.TXT'): - raise test_support.TestSkipped( - 'CP932.TXT not found, download from http://www.unicode.' - 'org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP932.TXT') - suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestCP932Map)) test_support.run_suite(suite) 1.2 +6 -6 cjkcodecs/tests/test_mapping_cp949.py Index: test_mapping_cp949.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_cp949.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_mapping_cp949.py 27 May 2003 05:17:48 -0000 1.1 +++ test_mapping_cp949.py 28 May 2003 08:02:06 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_cp949.py,v 1.1 2003/05/27 05:17:48 perky Exp $ +# $Id: test_mapping_cp949.py,v 1.2 2003/05/28 08:02:06 perky Exp $ # from test import test_support @@ -35,16 +35,16 @@ import sys, codecs, os import unittest +if not os.path.exists('CP949.TXT'): + raise test_support.TestSkipped( + 'CP949.TXT not found, download from http://www.unicode.' + 'org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP949.TXT') + class TestCP949Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp949' mapfilename = 'CP949.TXT' def test_main(): - if not os.path.exists('CP949.TXT'): - raise test_support.TestSkipped( - 'CP949.TXT not found, download from http://www.unicode.' - 'org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP949.TXT') - suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestCP949Map)) test_support.run_suite(suite) 1.2 +6 -6 cjkcodecs/tests/test_mapping_cp950.py Index: test_mapping_cp950.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_cp950.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_mapping_cp950.py 28 May 2003 07:01:35 -0000 1.1 +++ test_mapping_cp950.py 28 May 2003 08:02:06 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_cp950.py,v 1.1 2003/05/28 07:01:35 perky Exp $ +# $Id: test_mapping_cp950.py,v 1.2 2003/05/28 08:02:06 perky Exp $ # from test import test_support @@ -35,17 +35,17 @@ import sys, codecs, os import unittest +if not os.path.exists('CP950.TXT'): + raise test_support.TestSkipped( + 'CP950.TXT not found, download from http://www.unicode.' + 'org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT') + class TestCP950Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp950' mapfilename = 'CP950.TXT' def test_main(): - if not os.path.exists('CP950.TXT'): - raise test_support.TestSkipped( - 'CP950.TXT not found, download from http://www.unicode.' - 'org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT') - suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestCP950Map)) test_support.run_suite(suite) 1.2 +6 -6 cjkcodecs/tests/test_mapping_euc_jp.py Index: test_mapping_euc_jp.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_euc_jp.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_mapping_euc_jp.py 26 May 2003 11:10:50 -0000 1.1 +++ test_mapping_euc_jp.py 28 May 2003 08:02:06 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_euc_jp.py,v 1.1 2003/05/26 11:10:50 perky Exp $ +# $Id: test_mapping_euc_jp.py,v 1.2 2003/05/28 08:02:06 perky Exp $ # from test import test_support @@ -35,17 +35,17 @@ import sys, codecs, os import unittest +if not os.path.exists('EUC-JP.TXT'): + raise test_support.TestSkipped( + 'EUC-JP.TXT not found, download from http://people.freebsd' + '.org/~perky/i18n/EUC-JP.TXT') + class TestEUCJPMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'euc_jp' mapfilename = 'EUC-JP.TXT' def test_main(): - if not os.path.exists('EUC-JP.TXT'): - raise test_support.TestSkipped( - 'EUC-JP.TXT not found, download from http://people.freebsd' - '.org/~perky/i18n/EUC-JP.TXT') - suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestEUCJPMap)) test_support.run_suite(suite) 1.2 +6 -6 cjkcodecs/tests/test_mapping_euc_kr.py Index: test_mapping_euc_kr.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_euc_kr.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_mapping_euc_kr.py 27 May 2003 06:49:42 -0000 1.1 +++ test_mapping_euc_kr.py 28 May 2003 08:02:06 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_euc_kr.py,v 1.1 2003/05/27 06:49:42 perky Exp $ +# $Id: test_mapping_euc_kr.py,v 1.2 2003/05/28 08:02:06 perky Exp $ # from test import test_support @@ -35,17 +35,17 @@ import sys, codecs, os import unittest +if not os.path.exists('EUC-KR.TXT'): + raise test_support.TestSkipped( + 'EUC-KR.TXT not found, download from http://people.freebsd' + '.org/~perky/i18n/EUC-KR.TXT') + class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'euc_kr' mapfilename = 'EUC-KR.TXT' def test_main(): - if not os.path.exists('EUC-KR.TXT'): - raise test_support.TestSkipped( - 'EUC-KR.TXT not found, download from http://people.freebsd' - '.org/~perky/i18n/EUC-KR.TXT') - suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestEUCKRMap)) test_support.run_suite(suite) 1.2 +6 -6 cjkcodecs/tests/test_mapping_gb2312.py Index: test_mapping_gb2312.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_gb2312.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_mapping_gb2312.py 28 May 2003 07:48:15 -0000 1.1 +++ test_mapping_gb2312.py 28 May 2003 08:02:06 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_gb2312.py,v 1.1 2003/05/28 07:48:15 perky Exp $ +# $Id: test_mapping_gb2312.py,v 1.2 2003/05/28 08:02:06 perky Exp $ # from test import test_support @@ -35,17 +35,17 @@ import sys, codecs, os import unittest +if not os.path.exists('EUC-CN.TXT'): + raise test_support.TestSkipped( + 'EUC-CN.TXT not found, download from http://people.freebsd' + '.org/~perky/i18n/EUC-CN.TXT') + class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'gb2312' mapfilename = 'EUC-CN.TXT' def test_main(): - if not os.path.exists('EUC-CN.TXT'): - raise test_support.TestSkipped( - 'EUC-CN.TXT not found, download from http://people.freebsd' - '.org/~perky/i18n/EUC-CN.TXT') - suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestGB2312Map)) test_support.run_suite(suite) 1.2 +6 -6 cjkcodecs/tests/test_mapping_gbk.py Index: test_mapping_gbk.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_gbk.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_mapping_gbk.py 28 May 2003 07:48:15 -0000 1.1 +++ test_mapping_gbk.py 28 May 2003 08:02:07 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_gbk.py,v 1.1 2003/05/28 07:48:15 perky Exp $ +# $Id: test_mapping_gbk.py,v 1.2 2003/05/28 08:02:07 perky Exp $ # from test import test_support @@ -35,17 +35,17 @@ import sys, codecs, os import unittest +if not os.path.exists('CP936.TXT'): + raise test_support.TestSkipped( + 'CP936.TXT not found, download from http://www.unicode.' + 'org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT') + class TestGBKMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'gbk' mapfilename = 'CP936.TXT' def test_main(): - if not os.path.exists('CP936.TXT'): - raise test_support.TestSkipped( - 'CP936.TXT not found, download from http://www.unicode.' - 'org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT') - suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestGBKMap)) test_support.run_suite(suite) 1.2 +6 -6 cjkcodecs/tests/test_mapping_shift_jis.py Index: test_mapping_shift_jis.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/test_mapping_shift_jis.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_mapping_shift_jis.py 26 May 2003 11:10:50 -0000 1.1 +++ test_mapping_shift_jis.py 28 May 2003 08:02:07 -0000 1.2 @@ -27,7 +27,7 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: test_mapping_shift_jis.py,v 1.1 2003/05/26 11:10:50 perky Exp $ +# $Id: test_mapping_shift_jis.py,v 1.2 2003/05/28 08:02:07 perky Exp $ # from test import test_support @@ -35,17 +35,17 @@ import sys, codecs, os import unittest +if not os.path.exists('SHIFTJIS.TXT'): + raise test_support.TestSkipped( + 'SHIFTJIS.TXT not found, download from http://www.unicode.' + 'org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT') + class TestSJISMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'shift_jis' mapfilename = 'SHIFTJIS.TXT' def test_main(): - if not os.path.exists('SHIFTJIS.TXT'): - raise test_support.TestSkipped( - 'SHIFTJIS.TXT not found, download from http://www.unicode.' - 'org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT') - suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestSJISMap)) test_support.run_suite(suite) 1.2 +10 -4 cjkcodecs/tests/testall.py Index: testall.py =================================================================== RCS file: /cvsroot/koco/cjkcodecs/tests/testall.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- testall.py 27 May 2003 04:18:23 -0000 1.1 +++ testall.py 28 May 2003 08:02:07 -0000 1.2 @@ -27,11 +27,12 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# $Id: testall.py,v 1.1 2003/05/27 04:18:23 perky Exp $ +# $Id: testall.py,v 1.2 2003/05/28 08:02:07 perky Exp $ # import sys import os, unittest +from test import test_support def findtests(testdir='.'): tests = [] @@ -41,13 +42,18 @@ tests.append(name[:-3]) return tests -def runtest(test): +def loadtests(test): mod = __import__(test, globals(), locals(), []) - mod.test_main() + return unittest.findTestCases(mod) def main(): + suite = unittest.TestSuite() for test in findtests(): - runtest(test) + try: + suite.addTest(loadtests(test)) + except test_support.TestSkipped, msg: + print "%s - skipped: %s" % (test, msg) + test_support.run_suite(suite) if __name__ == '__main__': main() |