# Path: aiobotocore/response.py
# class AioReadTimeoutError(ReadTimeoutError, asyncio.TimeoutError):
# class StreamingBody(wrapt.ObjectProxy):
#     _DEFAULT_CHUNK_SIZE = 1024
#     def __init__(self, raw_stream, content_length):
#     async def __aenter__(self):
#     async def __aexit__(self, exc_type, exc_val, exc_tb):
#     def tell(self):
#     async def read(self, amt=None):
#     def __aiter__(self):
#     async def __anext__(self):
#     async def iter_lines(self, chunk_size=1024, keepends=False):
#     async def iter_chunks(self, chunk_size=_DEFAULT_CHUNK_SIZE):
#     def _verify_content_length(self):
# async def get_response(operation_model, http_response):


import io
import pytest
from aiobotocore import response
from botocore.exceptions import IncompleteReadError
@pytest.mark.moto
@pytest.mark.asyncio
async def test_streaming_body_with_single_read():
    body = AsyncBytesIO(b'123456789')
    stream = response.StreamingBody(body, content_length=10)
    with pytest.raises(IncompleteReadError):
        await stream.read()


@pytest.mark.moto
@pytest.mark.asyncio
async def test_streaming_body_closes():
    body = AsyncBytesIO(b'1234567890')
    stream = response.StreamingBody(body, content_length=10)
    assert body.closed is False
    stream.close()
    assert body.closed is True


@pytest.mark.moto
@pytest.mark.asyncio
async def test_default_iter_behavior():
    body = AsyncBytesIO(b'a' * 2048)
    stream = response.StreamingBody(body, content_length=2048)
    chunks = await _tolist(stream)
    assert len(chunks) == 2
    assert chunks, [b'a' * 1024 == b'a' * 1024]


@pytest.mark.moto

# Path: aiobotocore/response.py
# class AioReadTimeoutError(ReadTimeoutError, asyncio.TimeoutError):
# class StreamingBody(wrapt.ObjectProxy):
#     _DEFAULT_CHUNK_SIZE = 1024
#     def __init__(self, raw_stream, content_length):
#     async def __aenter__(self):
#     async def __aexit__(self, exc_type, exc_val, exc_tb):
#     def tell(self):
#     async def read(self, amt=None):
#     def __aiter__(self):
#     async def __anext__(self):
#     async def iter_lines(self, chunk_size=1024, keepends=False):
#     async def iter_chunks(self, chunk_size=_DEFAULT_CHUNK_SIZE):
#     def _verify_content_length(self):
# async def get_response(operation_model, http_response):


# Path: tests/test_response.py
import io
import pytest
from aiobotocore import response
from botocore.exceptions import IncompleteReadError

@pytest.mark.moto
@pytest.mark.asyncio
async def test_streaming_body_with_single_read():
    body = AsyncBytesIO(b'123456789')
    stream = response.StreamingBody(body, content_length=10)
    with pytest.raises(IncompleteReadError):
        await stream.read()


@pytest.mark.moto
@pytest.mark.asyncio
async def test_streaming_body_closes():
    body = AsyncBytesIO(b'1234567890')
    stream = response.StreamingBody(body, content_length=10)
    assert body.closed is False
    stream.close()
    assert body.closed is True


@pytest.mark.moto
@pytest.mark.asyncio
async def test_default_iter_behavior():
    body = AsyncBytesIO(b'a' * 2048)
    stream = response.StreamingBody(body, content_length=2048)
    chunks = await _tolist(stream)
    assert len(chunks) == 2
    assert chunks, [b'a' * 1024 == b'a' * 1024]


@pytest.mark.moto

@pytest.mark.asyncio