b.t.test_http_response : module documentation
Part of bzrlib.tests
Tests from HTTP response parsing.
The handle_response method read the response body of a GET request an returns
the corresponding RangeFile.
There are four different kinds of RangeFile:
- a whole file whose size is unknown, seen as a simple byte stream,
- a whole file whose size is known, we can't read past its end,
- a single range file, a part of a file with a start and a size,
- a multiple range file, several consecutive parts with known start offset
and size.
Some properties are common to all kinds:
- seek can only be forward (its really a socket underneath),
- read can't cross ranges,
- successive ranges are taken into account transparently,
- the expected pattern of use is either seek(offset)+read(size) or a single
read with no size specified. For multiple range files, multiple read() will
return the corresponding ranges, trying to read further will raise
InvalidHttpResponse.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.