The fetch function should return the expected bytearray response.
()
| 55 | |
| 56 | |
| 57 | async def test_fetch_bytearray(): |
| 58 | """ |
| 59 | The fetch function should return the expected bytearray response. |
| 60 | """ |
| 61 | response = await fetch("https://jsonplaceholder.typicode.com/todos/1") |
| 62 | assert response.ok |
| 63 | data = await response.bytearray() |
| 64 | assert isinstance(data, bytearray) |
| 65 | assert b"delectus aut autem" in data |
| 66 | assert b"completed" in data |
| 67 | assert b"false" in data |
| 68 | assert b"1" in data |
| 69 | |
| 70 | |
| 71 | async def test_fetch_bytearray_direct(): |