[Python-checkins] r68069 - sandbox/trunk/io-c/test_io.py

antoine.pitrou python-checkins at python.org
Tue Dec 30 18:03:45 CET 2008


Author: antoine.pitrou
Date: Tue Dec 30 18:03:44 2008
New Revision: 68069

Log:
make tests more friendly with the py3k implementation
a couple of them still fail but i believe it's because of genuine bugs




Modified:
   sandbox/trunk/io-c/test_io.py

Modified: sandbox/trunk/io-c/test_io.py
==============================================================================
--- sandbox/trunk/io-c/test_io.py	(original)
+++ sandbox/trunk/io-c/test_io.py	Tue Dec 30 18:03:44 2008
@@ -567,23 +567,23 @@
 
     def testWriteNonBlocking(self):
         raw = MockNonBlockWriterIO()
-        bufio = io.BufferedWriter(raw, 8)
+        bufio = io.BufferedWriter(raw, 8, 8)
 
         self.assertEquals(bufio.write(b"abcd"), 4)
         self.assertEquals(bufio.write(b"efghi"), 5)
         # 1 byte will be written, the rest will be buffered
         raw.block_on(b"k")
-        self.assertEquals(bufio.write(b"jklmnopqr"), 9)
+        self.assertEquals(bufio.write(b"jklmn"), 5)
  
-        # 4 bytes will be written, 8 will be buffered and the rest will be lost
+        # 8 bytes will be written, 8 will be buffered and the rest will be lost
         raw.block_on(b"0")
         try:
-            bufio.write(b"wxyz0123456789")
+            bufio.write(b"opqrwxyz0123456789")
         except io.BlockingIOError as e:
             written = e.characters_written
         else:
             self.fail("BlockingIOError should have been raised")
-        self.assertEquals(written, 12)
+        self.assertEquals(written, 16)
         self.assertEquals(raw.pop_written(),
             b"abcdefghijklmnopqrwxyz")
  


More information about the Python-checkins mailing list