Back to index

python3.2  3.2.2
Public Member Functions
test.test_httplib.NoEOFStringIO Class Reference

List of all members.

Public Member Functions

def read
def readline

Detailed Description

Like StringIO, but raises AssertionError on EOF.

This is used below to test that http.client doesn't try to read
more from the underlying file than it should.

Definition at line 54 of file test_httplib.py.


Member Function Documentation

def test.test_httplib.NoEOFStringIO.read (   self,
  n = -1 
)

Definition at line 60 of file test_httplib.py.

00060 
00061     def read(self, n=-1):
00062         data = io.BytesIO.read(self, n)
00063         if data == b'':
00064             raise AssertionError('caller tried to read past EOF')
00065         return data

Here is the caller graph for this function:

def test.test_httplib.NoEOFStringIO.readline (   self,
  length = None 
)

Definition at line 66 of file test_httplib.py.

00066 
00067     def readline(self, length=None):
00068         data = io.BytesIO.readline(self, length)
00069         if data == b'':
00070             raise AssertionError('caller tried to read past EOF')
00071         return data

Here is the caller graph for this function:


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