[Python-checkins] python/dist/src/Lib/test test_codecs.py, 1.11,
1.12
lemburg at users.sourceforge.net
lemburg at users.sourceforge.net
Sat Jul 10 14:06:13 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9544/Lib/test
Modified Files:
test_codecs.py
Log Message:
Add generic codecs.encode() and .decode() APIs that don't impose
any restriction on the return type (like unicode.encode() et al. do).
Index: test_codecs.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecs.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** test_codecs.py 8 Jul 2004 04:22:19 -0000 1.11
--- test_codecs.py 10 Jul 2004 12:06:10 -0000 1.12
***************
*** 337,340 ****
--- 337,349 ----
self.assertEquals(unicode("python.org", "idna"), u"python.org")
+ class CodecsModuleTest(unittest.TestCase):
+
+ def test_decode(self):
+ self.assertEquals(codecs.decode('\xe4\xf6\xfc', 'latin-1'),
+ u'\xe4\xf6\xfc')
+ def test_encode(self):
+ self.assertEquals(codecs.encode(u'\xe4\xf6\xfc', 'latin-1'),
+ '\xe4\xf6\xfc')
+
def test_main():
test_support.run_unittest(
***************
*** 344,348 ****
PunycodeTest,
NameprepTest,
! CodecTest
)
--- 353,358 ----
PunycodeTest,
NameprepTest,
! CodecTest,
! CodecsModuleTest
)
More information about the Python-checkins
mailing list