MCPcopy Index your code
hub / github.com/pyscript/pyscript / test_fetch_json_direct

Function test_fetch_json_direct

core/tests/python/tests/test_fetch.py:22–30  ·  view source on GitHub ↗

The fetch function should support direct method chaining for JSON.

()

Source from the content-addressed store, hash-verified

20
21
22async def test_fetch_json_direct():
23 """
24 The fetch function should support direct method chaining for JSON.
25 """
26 data = await fetch("https://jsonplaceholder.typicode.com/todos/1").json()
27 assert data["userId"] == 1
28 assert data["id"] == 1
29 assert data["title"] == "delectus aut autem"
30 assert data["completed"] is False
31
32
33async def test_fetch_text():

Callers

nothing calls this directly

Calls 2

fetchFunction · 0.90
jsonMethod · 0.45

Tested by

no test coverage detected