[Python-checkins] r57265 - python/branches/alex-py3k/Lib/test/test_largefile.py

alexandre.vassalotti python-checkins at python.org
Tue Aug 21 20:25:59 CEST 2007


Author: alexandre.vassalotti
Date: Tue Aug 21 20:25:59 2007
New Revision: 57265

Modified:
   python/branches/alex-py3k/Lib/test/test_largefile.py
Log:
Fix failing tests due to the new behaviour of truncate().


Modified: python/branches/alex-py3k/Lib/test/test_largefile.py
==============================================================================
--- python/branches/alex-py3k/Lib/test/test_largefile.py	(original)
+++ python/branches/alex-py3k/Lib/test/test_largefile.py	Tue Aug 21 20:25:59 2007
@@ -152,7 +152,7 @@
         newsize -= 1
         f.seek(42)
         f.truncate(newsize)
-        expect(f.tell(), 42)        # else pointer moved
+        expect(f.tell(), newsize)   # pointer moved
         f.seek(0, 2)
         expect(f.tell(), newsize)   # else wasn't truncated
 
@@ -161,7 +161,8 @@
         # cut it waaaaay back
         f.seek(0)
         f.truncate(1)
-        expect(f.tell(), 0)         # else pointer moved
+        expect(f.tell(), 1)         # pointer moved
+        f.seek(0)
         expect(len(f.read()), 1)    # else wasn't truncated
 
     finally:


More information about the Python-checkins mailing list