예제 #1
0
async def responses_double():
    # mimics aiohttp.ClientResponse
    response1 = AsyncMock()
    response1.headers = {"Content-Range": "bytes 0-63/65"}
    response1.status = 206
    response1.read = AsyncMock(return_value=b"X" * 64)
    response2 = AsyncMock()
    response2.headers = {"Content-Range": "bytes 64-64/65"}
    response2.status = 206
    response2.read = AsyncMock(return_value=b"X")
    return [response1, response2]
예제 #2
0
async def responses_single():
    # mimics aiohttp.ClientResponse
    response = AsyncMock()
    response.headers = {"Content-Range": "bytes 0-41/42"}
    response.status = 206
    response.read = AsyncMock(return_value=b"X" * 42)
    return [response]