Back to index

python3.2  3.2.2
Public Member Functions | Private Attributes
test.test_uu.FakeIO Class Reference

List of all members.

Public Member Functions

def __init__
def getvalue

Private Attributes

 _encoding
 _errors

Detailed Description

Text I/O implementation using an in-memory buffer.

Can be a used as a drop-in replacement for sys.stdin and sys.stdout.

Definition at line 21 of file test_uu.py.


Constructor & Destructor Documentation

def test.test_uu.FakeIO.__init__ (   self,
  initial_value = "",
  encoding = "utf-8",
  errors = "strict",
  newline = "\n" 
)

Definition at line 30 of file test_uu.py.

00030 
00031                  errors="strict", newline="\n"):
00032         super(FakeIO, self).__init__(io.BytesIO(),
00033                                      encoding=encoding,
00034                                      errors=errors,
00035                                      newline=newline)
00036         self._encoding = encoding
00037         self._errors = errors
00038         if initial_value:
00039             if not isinstance(initial_value, str):
00040                 initial_value = str(initial_value)
00041             self.write(initial_value)
00042             self.seek(0)

Here is the caller graph for this function:


Member Function Documentation

Definition at line 43 of file test_uu.py.

00043 
00044     def getvalue(self):
00045         self.flush()
00046         return self.buffer.getvalue().decode(self._encoding, self._errors)
00047 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 35 of file test_uu.py.

Definition at line 36 of file test_uu.py.


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