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

Function test_fetch_with_custom_headers

core/tests/python/tests/test_fetch.py:211–221  ·  view source on GitHub ↗

The fetch function should support custom headers.

()

Source from the content-addressed store, hash-verified

209
210
211async def test_fetch_with_custom_headers():
212 """
213 The fetch function should support custom headers.
214 """
215 response = await fetch(
216 "https://jsonplaceholder.typicode.com/todos/1",
217 headers={"Accept": "application/json"},
218 )
219 assert response.ok
220 data = await response.json()
221 assert data["id"] == 1
222
223
224async def test_fetch_multiple_data_extractions():

Callers

nothing calls this directly

Calls 2

fetchFunction · 0.90
jsonMethod · 0.45

Tested by

no test coverage detected