The fetch function should return the expected array buffer response.
()
| 78 | |
| 79 | |
| 80 | async def test_fetch_array_buffer(): |
| 81 | """ |
| 82 | The fetch function should return the expected array buffer response. |
| 83 | """ |
| 84 | response = await fetch("https://jsonplaceholder.typicode.com/todos/1") |
| 85 | assert response.ok |
| 86 | data = await response.arrayBuffer() |
| 87 | bytes_ = bytes(data) |
| 88 | assert b"delectus aut autem" in bytes_ |
| 89 | assert b"completed" in bytes_ |
| 90 | assert b"false" in bytes_ |
| 91 | assert b"1" in bytes_ |
| 92 | |
| 93 | |
| 94 | async def test_fetch_array_buffer_direct(): |
nothing calls this directly
no test coverage detected