[Python-checkins] CVS: python/dist/src/Lib/test test_StringIO.py,1.10.6.1,1.10.6.2

Michael Hudson mwh@users.sourceforge.net
Mon, 18 Mar 2002 05:31:33 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv23898/test

Modified Files:
      Tag: release22-maint
	test_StringIO.py 
Log Message:
Make StringIO work in non-unicode builds.

Lots of tests fail in non-unicode builds, but I think most of these are 
"bugs" in the tests.  I hope so, anyway.


Index: test_StringIO.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_StringIO.py,v
retrieving revision 1.10.6.1
retrieving revision 1.10.6.2
diff -C2 -d -r1.10.6.1 -r1.10.6.2
*** test_StringIO.py	28 Jan 2002 15:01:42 -0000	1.10.6.1
--- test_StringIO.py	18 Mar 2002 13:31:31 -0000	1.10.6.2
***************
*** 72,89 ****
      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):
--- 72,90 ----
      MODULE = StringIO
  
!     if test_support.have_unicode:
!         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):