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

antoine.pitrou python-checkins at python.org
Sat Jan 17 03:53:40 CET 2009


Author: antoine.pitrou
Date: Sat Jan 17 03:53:39 2009
New Revision: 68645

Log:
Add a test for non-blocking peek()



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	Sat Jan 17 03:53:39 2009
@@ -597,12 +597,13 @@
 
     def testReadNonBlocking(self):
         # Inject some None's in there to simulate EWOULDBLOCK
-        rawio = MockRawIO((b"abc", b"d", None, b"efg", None, None))
+        rawio = MockRawIO((b"abc", b"d", None, b"efg", None, None, None))
         bufio = self.tp(rawio)
 
         self.assertEquals(b"abcd", bufio.read(6))
         self.assertEquals(b"e", bufio.read(1))
         self.assertEquals(b"fg", bufio.read())
+        self.assertEquals(b"", bufio.peek(1))
         self.assert_(None is bufio.read())
         self.assertEquals(b"", bufio.read())
 


More information about the Python-checkins mailing list