Revision: 5323
http://jython.svn.sourceforge.net/jython/?rev=5323&view=rev
Author: leosoto
Date: 2008-09-13 17:04:58 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
Test for the 'feature' described on #1089: cStringIO.StringIO.read always returns string objects
Added Paths:
-----------
trunk/jython/Lib/test/test_StringIO_jy.py
Added: trunk/jython/Lib/test/test_StringIO_jy.py
===================================================================
--- trunk/jython/Lib/test/test_StringIO_jy.py (rev 0)
+++ trunk/jython/Lib/test/test_StringIO_jy.py 2008-09-13 17:04:58 UTC (rev 5323)
@@ -0,0 +1,20 @@
+import unittest
+import cStringIO
+from test import test_support
+
+class TestUnicodeInput(unittest.TestCase):
+ def test_differences_handling_unicode(self):
+ # Test for the "feature" described on #1089.
+ #
+ # Basically, StringIO returns unicode objects if you feed it unicode,
+ # but cStringIO don't. This should change in future versions of
+ # CPython and Jython.
+ self.assertEqual(u'foo', cStringIO.StringIO(u'foo').read())
+ self.assertEqual('foo', cStringIO.StringIO(u'foo').read())
+
+
+def test_main():
+ test_support.run_unittest(TestUnicodeInput)
+
+if __name__ == '__main__':
+ test_main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|