class documentation

A mixin for TestCase subclasses which defines a number of tests against _InputStream. The subclass is expected to create a file-like object to be wrapped by an _InputStream under test.

Method getFileType Undocumented
Method test_iterable Iterating over _InputStream produces lines from the input stream.
Method test_iterableAfterRead Iterating over _InputStream after calling _InputStream.read produces lines from the input stream starting from the first byte after the last byte returned by the read call.
Method test_readAll Calling _InputStream.read with no arguments returns the entire input stream.
Method test_readline Calling _InputStream.readline with no argument returns one line from the input stream.
Method test_readlineMoreThan Calling _InputStream.readline with an integer which is greater than the number of bytes in the next line returns only the next line.
Method test_readlineNegative Calling _InputStream.readline with a negative integer as an argument returns one line from the input stream.
Method test_readlineNone Calling _InputStream.readline with None as an argument returns one line from the input stream.
Method test_readlines Calling _InputStream.readlines with no arguments returns a list of all lines from the input stream.
Method test_readlinesAfterRead Calling _InputStream.readlines after a call to _InputStream.read returns lines starting at the byte after the last byte returned by the read call.
Method test_readlinesMoreThan Calling _InputStream.readlines with an integer which is greater than the total number of bytes in the input stream returns a list of all lines from the input.
Method test_readlinesNegative Calling _InputStream.readlines with a negative integer as an argument returns a list of all lines from the input.
Method test_readlinesNone Calling _InputStream.readlines with None as an argument returns all lines from the input.
Method test_readlineSome Calling _InputStream.readline with an integer returns at most that many bytes, even if it is not enough to make up a complete line.
Method test_readlinesSome Calling _InputStream.readlines with an integer as an argument returns a list of lines from the input stream with the argument serving as an approximate bound on the total number of bytes to read.
Method test_readlineTwice Calling _InputStream.readline a second time returns the line following the line returned by the first call.
Method test_readMoreThan Calling _InputStream.read with an integer that is greater than the total number of bytes in the input stream returns all bytes in the input stream.
Method test_readNegative Calling _InputStream.read with a negative integer as an argument returns all bytes in the input stream.
Method test_readNone Calling _InputStream.read with None as an argument returns all bytes in the input stream.
Method test_readSome Calling _InputStream.read with an integer returns that many bytes from the input stream, as long as it is less than or equal to the total number of bytes available.
Method test_readTwice Calling _InputStream.read a second time returns bytes starting from the position after the last byte returned by the previous read.
Method _renderAndReturnReaderResult Undocumented

Inherited from WSGITestsMixin:

Method getContentFromResponse Undocumented
Method lowLevelRender No summary
Method prepareRequest Prepare a Request which, when a request is received, captures the environ and start_response callable passed to a WSGI app.
Method render Undocumented
Method requestFactoryFactory Undocumented
Method setUp Undocumented
Instance Variable channelFactory A no-argument callable which will be invoked to create a new HTTP channel to associate with request objects.
Instance Variable reactor Undocumented
Instance Variable threadpool Undocumented
def test_iterable(self): (source)

Iterating over _InputStream produces lines from the input stream.

def test_iterableAfterRead(self): (source)

Iterating over _InputStream after calling _InputStream.read produces lines from the input stream starting from the first byte after the last byte returned by the read call.

def test_readAll(self): (source)

Calling _InputStream.read with no arguments returns the entire input stream.

def test_readline(self): (source)

Calling _InputStream.readline with no argument returns one line from the input stream.

def test_readlineMoreThan(self): (source)

Calling _InputStream.readline with an integer which is greater than the number of bytes in the next line returns only the next line.

def test_readlineNegative(self): (source)

Calling _InputStream.readline with a negative integer as an argument returns one line from the input stream.

def test_readlineNone(self): (source)

Calling _InputStream.readline with None as an argument returns one line from the input stream.

def test_readlines(self): (source)

Calling _InputStream.readlines with no arguments returns a list of all lines from the input stream.

def test_readlinesAfterRead(self): (source)

Calling _InputStream.readlines after a call to _InputStream.read returns lines starting at the byte after the last byte returned by the read call.

def test_readlinesMoreThan(self): (source)

Calling _InputStream.readlines with an integer which is greater than the total number of bytes in the input stream returns a list of all lines from the input.

def test_readlinesNegative(self): (source)

Calling _InputStream.readlines with a negative integer as an argument returns a list of all lines from the input.

def test_readlinesNone(self): (source)

Calling _InputStream.readlines with None as an argument returns all lines from the input.

def test_readlineSome(self): (source)

Calling _InputStream.readline with an integer returns at most that many bytes, even if it is not enough to make up a complete line.

COMPATIBILITY NOTE: the size argument is excluded from the WSGI specification, but is provided here anyhow, because useful libraries such as python stdlib's cgi.py assume their input file-like-object supports readline with a size argument. If you use it, be aware your application may not be portable to other conformant WSGI servers.

def test_readlinesSome(self): (source)

Calling _InputStream.readlines with an integer as an argument returns a list of lines from the input stream with the argument serving as an approximate bound on the total number of bytes to read.

def test_readlineTwice(self): (source)

Calling _InputStream.readline a second time returns the line following the line returned by the first call.

def test_readMoreThan(self): (source)

Calling _InputStream.read with an integer that is greater than the total number of bytes in the input stream returns all bytes in the input stream.

def test_readNegative(self): (source)

Calling _InputStream.read with a negative integer as an argument returns all bytes in the input stream.

def test_readNone(self): (source)

Calling _InputStream.read with None as an argument returns all bytes in the input stream.

def test_readSome(self): (source)

Calling _InputStream.read with an integer returns that many bytes from the input stream, as long as it is less than or equal to the total number of bytes available.

def test_readTwice(self): (source)

Calling _InputStream.read a second time returns bytes starting from the position after the last byte returned by the previous read.

def _renderAndReturnReaderResult(self, reader, content): (source)

Undocumented