[Python-checkins] CVS: python/dist/src/Lib/test test_StringIO.py,1.1,1.2
Fred L. Drake
python-dev@python.org
Wed, 27 Sep 2000 21:25:36 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv27037
Modified Files:
test_StringIO.py
Log Message:
Added some tests for the truncate() method; one is commented out because
cStringIO does not get it right (reported as SF bug #115531).
Added test for ValueError when write() is called on a closed StringIO
object. Commented out because cStringIO does not get it right
(reported as SF bug #115530).
Index: test_StringIO.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_StringIO.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_StringIO.py 2000/09/19 16:35:39 1.1
--- test_StringIO.py 2000/09/28 04:25:33 1.2
***************
*** 10,13 ****
--- 10,36 ----
print len(f.readlines(60))
+ f = module.StringIO()
+ f.write(s)
+ f.seek(10)
+ f.truncate()
+ print `f.getvalue()`
+ # This test fails for cStringIO; reported as SourceForge bug #115531;
+ # please uncomment this test when that bug is fixed.
+ # http://sourceforge.net/bugs/?func=detailbug&bug_id=115531&group_id=5470
+ ## f.seek(0)
+ ## f.truncate(5)
+ ## print `f.getvalue()`
+
+ # This test fails for cStringIO; reported as SourceForge bug #115530;
+ # please uncomment this test when that bug is fixed.
+ # http://sourceforge.net/bugs/?func=detailbug&bug_id=115530&group_id=5470
+ ## try:
+ ## f.write("frobnitz")
+ ## except ValueError, e:
+ ## print "Caught expected ValueError writing to closed StringIO:"
+ ## print e
+ ## else:
+ ## print "Failed to catch ValueError writing to closed StringIO."
+
# Don't bother testing cStringIO without
import StringIO, cStringIO