[Python-checkins] CVS: python/dist/src/Lib/test test_StringIO.py,1.10,1.10.6.1
Michael Hudson
mwh@users.sourceforge.net
Mon, 28 Jan 2002 07:01:45 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv30185
Modified Files:
Tag: release22-maint
test_StringIO.py
Log Message:
It's merge time!
Backport lemburg's checkin of revision 1.11:
Restore Python 2.1 StringIO.py behaviour: support concatenating
Unicode string snippets to larger Unicode strings.
This fix should also go into Python 2.2.1.
Index: test_StringIO.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_StringIO.py,v
retrieving revision 1.10
retrieving revision 1.10.6.1
diff -C2 -d -r1.10 -r1.10.6.1
*** test_StringIO.py 2001/12/09 20:06:32 1.10
--- test_StringIO.py 2002/01/28 15:01:42 1.10.6.1
***************
*** 72,75 ****
--- 72,90 ----
MODULE = StringIO
+ def test_unicode(self):
+
+ # The StringIO module also supports concatenating Unicode
+ # snippets to larger Unicode strings. This is tested by this
+ # method. Note that cStringIO does not support this extension.
+
+ f = self.MODULE.StringIO()
+ f.write(self._line[:6])
+ f.seek(3)
+ f.write(unicode(self._line[20:26]))
+ f.write(unicode(self._line[52]))
+ s = f.getvalue()
+ self.assertEqual(s, unicode('abcuvwxyz!'))
+ self.assertEqual(type(s), types.UnicodeType)
+
class TestcStringIO(TestGenericStringIO):
MODULE = cStringIO