Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_io.PyMockNonBlockWriterIO Class Reference
Inheritance diagram for test.test_io.PyMockNonBlockWriterIO:
Inheritance graph
[legend]
Collaboration diagram for test.test_io.PyMockNonBlockWriterIO:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def pop_written
def block_on
def readable
def seekable
def writable
def write

Static Public Attributes

 BlockingIOError = pyio.BlockingIOError

Detailed Description

Definition at line 254 of file test_io.py.


Member Function Documentation

def test.test_io.MockNonBlockWriterIO.block_on (   self,
  char 
) [inherited]
Block when a given char is encountered.

Definition at line 223 of file test_io.py.

00223 
00224     def block_on(self, char):
00225         """Block when a given char is encountered."""
00226         self._blocker_char = char

Definition at line 218 of file test_io.py.

00218 
00219     def pop_written(self):
00220         s = b"".join(self._write_stack)
00221         self._write_stack[:] = []
00222         return s

def test.test_io.MockNonBlockWriterIO.readable (   self) [inherited]

Definition at line 227 of file test_io.py.

00227 
00228     def readable(self):
00229         return True

def test.test_io.MockNonBlockWriterIO.seekable (   self) [inherited]

Definition at line 230 of file test_io.py.

00230 
00231     def seekable(self):
00232         return True

def test.test_io.MockNonBlockWriterIO.writable (   self) [inherited]

Definition at line 233 of file test_io.py.

00233 
00234     def writable(self):
00235         return True

def test.test_io.MockNonBlockWriterIO.write (   self,
  b 
) [inherited]

Definition at line 236 of file test_io.py.

00236 
00237     def write(self, b):
00238         b = bytes(b)
00239         n = -1
00240         if self._blocker_char:
00241             try:
00242                 n = b.index(self._blocker_char)
00243             except ValueError:
00244                 pass
00245             else:
00246                 self._blocker_char = None
00247                 self._write_stack.append(b[:n])
00248                 raise self.BlockingIOError(0, "test blocking", n)
00249         self._write_stack.append(b)
00250         return len(b)


Member Data Documentation

test.test_io.PyMockNonBlockWriterIO.BlockingIOError = pyio.BlockingIOError [static]

Definition at line 255 of file test_io.py.


The documentation for this class was generated from the following file: