The fetch function should return the expected JSON response.
()
| 7 | |
| 8 | |
| 9 | async def test_fetch_json(): |
| 10 | """ |
| 11 | The fetch function should return the expected JSON response. |
| 12 | """ |
| 13 | response = await fetch("https://jsonplaceholder.typicode.com/todos/1") |
| 14 | assert response.ok |
| 15 | data = await response.json() |
| 16 | assert data["userId"] == 1 |
| 17 | assert data["id"] == 1 |
| 18 | assert data["title"] == "delectus aut autem" |
| 19 | assert data["completed"] is False |
| 20 | |
| 21 | |
| 22 | async def test_fetch_json_direct(): |