Thread: [KoCo-CVS] [Commit] KoreanCodecs/test test_cp949.py test_mackorean.py
Brought to you by:
perky
From: Hye-Shik C. <pe...@us...> - 2003-01-10 04:26:44
|
perky 03/01/09 20:26:43 Modified: test test_cp949.py test_mackorean.py Log: Fetch mapping files from unicode.org site. Revision Changes Path 1.9 +10 -2 KoreanCodecs/test/test_cp949.py Index: test_cp949.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/test/test_cp949.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- test_cp949.py 10 Jan 2003 03:15:25 -0000 1.8 +++ test_cp949.py 10 Jan 2003 04:26:43 -0000 1.9 @@ -16,7 +16,7 @@ # along with KoreanCodecs; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: test_cp949.py,v 1.8 2003/01/10 03:15:25 perky Exp $ +# $Id: test_cp949.py,v 1.9 2003/01/10 04:26:43 perky Exp $ # import CodecTestBase @@ -38,7 +38,15 @@ ) def test_mapping(self): - for line in open('mappings/cp949.txt'): + import sys, os, urllib + + if not os.access('map-cp949.txt', os.R_OK): + sys.stdout.write('(Trying to download cp949 mapping) ') + sys.stdout.flush() + urllib.urlretrieve('http://www.unicode.org/Public/MAPPINGS' + '/VENDORS/MICSFT/WINDOWS/CP949.TXT', 'map-cp949.txt') + + for line in open('map-cp949.txt'): if not line: break data = line.split('#')[0].strip().split() 1.2 +10 -2 KoreanCodecs/test/test_mackorean.py Index: test_mackorean.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/test/test_mackorean.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test_mackorean.py 10 Jan 2003 03:15:25 -0000 1.1 +++ test_mackorean.py 10 Jan 2003 04:26:43 -0000 1.2 @@ -16,7 +16,7 @@ # along with KoreanCodecs; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: test_mackorean.py,v 1.1 2003/01/10 03:15:25 perky Exp $ +# $Id: test_mackorean.py,v 1.2 2003/01/10 04:26:43 perky Exp $ # import CodecTestBase @@ -40,7 +40,15 @@ ) def test_mapping(self): - for line in open('mappings/MacKorean.txt'): + import os, urllib, sys + + if not os.access('map-mackorean.txt', os.R_OK): + sys.stdout.write('(Trying to download MacKorean mapping) ') + sys.stdout.flush() + urllib.urlretrieve('http://www.unicode.org/Public/MAPPINGS' + '/VENDORS/APPLE/KOREAN.TXT', 'map-mackorean.txt') + + for line in open('map-mackorean.txt'): if not line: break data = line.split('#')[0].strip().split() |
From: Hye-Shik C. <pe...@us...> - 2003-01-10 04:29:37
|
perky 03/01/09 20:29:35 Modified: test test_cp949.py test_mackorean.py Log: Use self.encoding instead of hardcoded encoding name. Revision Changes Path 1.10 +3 -3 KoreanCodecs/test/test_cp949.py Index: test_cp949.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/test/test_cp949.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- test_cp949.py 10 Jan 2003 04:26:43 -0000 1.9 +++ test_cp949.py 10 Jan 2003 04:29:34 -0000 1.10 @@ -16,7 +16,7 @@ # along with KoreanCodecs; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: test_cp949.py,v 1.9 2003/01/10 04:26:43 perky Exp $ +# $Id: test_cp949.py,v 1.10 2003/01/10 04:29:34 perky Exp $ # import CodecTestBase @@ -62,8 +62,8 @@ continue unich = unichrs(data[1]) - self.assertEqual(unich.encode('cp949'), cp949ch) - self.assertEqual(unicode(cp949ch, 'cp949'), unich) + self.assertEqual(unich.encode(self.encoding), cp949ch) + self.assertEqual(unicode(cp949ch, self.encoding), unich) class TestCP949_CExtension(Shield.TestCP949Base): encoding = 'korean.c.cp949' 1.3 +3 -3 KoreanCodecs/test/test_mackorean.py Index: test_mackorean.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/test/test_mackorean.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_mackorean.py 10 Jan 2003 04:26:43 -0000 1.2 +++ test_mackorean.py 10 Jan 2003 04:29:34 -0000 1.3 @@ -16,7 +16,7 @@ # along with KoreanCodecs; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: test_mackorean.py,v 1.2 2003/01/10 04:26:43 perky Exp $ +# $Id: test_mackorean.py,v 1.3 2003/01/10 04:29:34 perky Exp $ # import CodecTestBase @@ -65,8 +65,8 @@ continue unich = unichrs(data[1]) - self.assertEqual(unich.encode('mackorean'), macch) - self.assertEqual(unicode(macch, 'mackorean'), unich) + self.assertEqual(unich.encode(self.encoding), macch) + self.assertEqual(unicode(macch, self.encoding), unich) #class TestMacKorean_CExtension(Shield.TestMacKorean_Base): # encoding = 'korean.c.mackorean' |
From: Hye-Shik C. <pe...@us...> - 2003-01-11 15:01:58
|
perky 03/01/11 07:01:57 Modified: test test_cp949.py test_mackorean.py Log: Don't retrieve mapping file automatically, give a chance to user. Revision Changes Path 1.11 +8 -7 KoreanCodecs/test/test_cp949.py Index: test_cp949.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/test/test_cp949.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- test_cp949.py 10 Jan 2003 04:29:34 -0000 1.10 +++ test_cp949.py 11 Jan 2003 15:01:56 -0000 1.11 @@ -16,7 +16,7 @@ # along with KoreanCodecs; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: test_cp949.py,v 1.10 2003/01/10 04:29:34 perky Exp $ +# $Id: test_cp949.py,v 1.11 2003/01/11 15:01:56 perky Exp $ # import CodecTestBase @@ -38,15 +38,16 @@ ) def test_mapping(self): - import sys, os, urllib + import sys, os - if not os.access('map-cp949.txt', os.R_OK): - sys.stdout.write('(Trying to download cp949 mapping) ') + if not os.access('CP949.TXT', os.R_OK): + sys.stdout.write('skipped -- CP949.TXT not found, download from' + ' http://www.unicode.org/Public/MAPPINGS' + '/VENDORS/MICSFT/WINDOWS/CP949.TXT ') sys.stdout.flush() - urllib.urlretrieve('http://www.unicode.org/Public/MAPPINGS' - '/VENDORS/MICSFT/WINDOWS/CP949.TXT', 'map-cp949.txt') + return - for line in open('map-cp949.txt'): + for line in open('CP949.TXT'): if not line: break data = line.split('#')[0].strip().split() 1.4 +8 -7 KoreanCodecs/test/test_mackorean.py Index: test_mackorean.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/test/test_mackorean.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- test_mackorean.py 10 Jan 2003 04:29:34 -0000 1.3 +++ test_mackorean.py 11 Jan 2003 15:01:56 -0000 1.4 @@ -16,7 +16,7 @@ # along with KoreanCodecs; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: test_mackorean.py,v 1.3 2003/01/10 04:29:34 perky Exp $ +# $Id: test_mackorean.py,v 1.4 2003/01/11 15:01:56 perky Exp $ # import CodecTestBase @@ -40,15 +40,16 @@ ) def test_mapping(self): - import os, urllib, sys + import os, sys - if not os.access('map-mackorean.txt', os.R_OK): - sys.stdout.write('(Trying to download MacKorean mapping) ') + if not os.access('KOREAN.TXT', os.R_OK): + sys.stdout.write('skipped -- KOREAN.TXT not found, download from' + ' http://www.unicode.org/Public/MAPPINGS' + '/VENDORS/APPLE/KOREAN.TXT ') sys.stdout.flush() - urllib.urlretrieve('http://www.unicode.org/Public/MAPPINGS' - '/VENDORS/APPLE/KOREAN.TXT', 'map-mackorean.txt') + return - for line in open('map-mackorean.txt'): + for line in open('KOREAN.TXT'): if not line: break data = line.split('#')[0].strip().split() |