twisted.web.test.test_wsgi.InputStreamTestMixin(WSGITestsMixin) class documentationtwisted.web.test.test_wsgi
(View In Hierarchy)
Known subclasses: twisted.web.test.test_wsgi.InputStreamBytesIOTests, twisted.web.test.test_wsgi.InputStreamCStringIOTests, twisted.web.test.test_wsgi.InputStreamStringIOTests, twisted.web.test.test_wsgi.InputStreamTemporaryFileTests
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_readAll | Calling _InputStream.readwith no arguments returns the entire input stream. | 
| Method | test_readSome | Calling _InputStream.readwith 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_readMoreThan | Calling _InputStream.readwith an integer that is greater than the total number of bytes in the input
stream returns all bytes in the input stream. | 
| Method | test_readTwice | Calling _InputStream.reada second time returns bytes starting from the position after the last byte 
returned by the previous read. | 
| Method | test_readNone | Calling _InputStream.readwithNoneas an argument returns all bytes in the input stream. | 
| Method | test_readNegative | Calling _InputStream.readwith a negative integer as an argument returns all bytes in the input 
stream. | 
| Method | test_readline | Calling _InputStream.readlinewith no argument returns one line from the input stream. | 
| Method | test_readlineSome | Calling _InputStream.readlinewith an integer returns at most that many bytes, even if it is not enough 
to make up a complete line. | 
| Method | test_readlineMoreThan | Calling _InputStream.readlinewith an integer which is greater than the number of bytes in the next line 
returns only the next line. | 
| Method | test_readlineTwice | Calling _InputStream.readlinea second time returns the line following the line returned by the first 
call. | 
| Method | test_readlineNone | Calling _InputStream.readlinewithNoneas an argument returns one line from the input stream. | 
| Method | test_readlineNegative | Calling _InputStream.readlinewith a negative integer as an argument returns one line from the input 
stream. | 
| Method | test_readlines | Calling _InputStream.readlineswith no arguments returns a list of all lines from the input stream. | 
| Method | test_readlinesSome | Calling _InputStream.readlineswith 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_readlinesMoreThan | Calling _InputStream.readlineswith 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_readlinesAfterRead | Calling _InputStream.readlinesafter a call to_InputStream.readreturns lines starting at the byte after the last byte returned by thereadcall. | 
| Method | test_readlinesNone | Calling _InputStream.readlineswithNoneas an argument returns all lines from the input. | 
| Method | test_readlinesNegative | Calling _InputStream.readlineswith a negative integer as an argument returns a list of all lines from the
input. | 
| Method | test_iterable | Iterating over _InputStreamproduces lines from the input stream. | 
| Method | test_iterableAfterRead | Iterating over _InputStreamafter calling_InputStream.readproduces lines from the input stream starting from the first byte after the
last byte returned by thereadcall. | 
| Method | _renderAndReturnReaderResult | Undocumented | 
Inherited from WSGITestsMixin:
| Instance Variable | channelFactory | A no-argument callable which will be invoked to create a new HTTP channel to associate with request objects. | 
| Method | setUp | Undocumented | 
| Method | lowLevelRender | |
| Method | render | Undocumented | 
| Method | requestFactoryFactory | Undocumented | 
| Method | getContentFromResponse | Undocumented | 
| Method | prepareRequest | Prepare a Requestwhich, when
a request is received, captures theenvironandstart_responsecallable passed to a WSGI app. | 
Calling _InputStream.read
with no arguments returns the entire input stream.
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.
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.
Calling _InputStream.read
a second time returns bytes starting from the position after the last byte 
returned by the previous read.
Calling _InputStream.read
with None
as an argument returns all bytes in the input stream.
Calling _InputStream.read
with a negative integer as an argument returns all bytes in the input 
stream.
Calling _InputStream.readline
with no argument returns one line from the input stream.
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.
Calling _InputStream.readline
with an integer which is greater than the number of bytes in the next line 
returns only the next line.
Calling _InputStream.readline
a second time returns the line following the line returned by the first 
call.
Calling _InputStream.readline
with None
as an argument returns one line from the input stream.
Calling _InputStream.readline
with a negative integer as an argument returns one line from the input 
stream.
Calling _InputStream.readlines
with no arguments returns a list of all lines from the input stream.
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.
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.
Calling _InputStream.readlines
after a call to _InputStream.read
returns lines starting at the byte after the last byte returned by the 
read call.
Calling _InputStream.readlines
with None
as an argument returns all lines from the input.
Calling _InputStream.readlines
with a negative integer as an argument returns a list of all lines from the
input.
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.