Exemplo n.º 1
0
async def test_data_wrapper() -> None:
    wrapper = DataBody(b"abcdef")
    results = []
    async with wrapper as response:
        async for data in response:
            results.append(data)
    assert results == [b"abcdef"]
Exemplo n.º 2
0
async def test_data_wrapper_sequence_conversion() -> None:
    wrapper = DataBody(b"abcdef")
    assert (await wrapper.convert_to_sequence()) == b"abcdef"