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

Function test_fetch_text

core/tests/python/tests/test_fetch.py:33–43  ·  view source on GitHub ↗

The fetch function should return the expected text response.

()

Source from the content-addressed store, hash-verified

31
32
33async def test_fetch_text():
34 """
35 The fetch function should return the expected text response.
36 """
37 response = await fetch("https://jsonplaceholder.typicode.com/todos/1")
38 assert response.ok
39 text = await response.text()
40 assert "delectus aut autem" in text
41 assert "completed" in text
42 assert "false" in text
43 assert "1" in text
44
45
46async def test_fetch_text_direct():

Callers

nothing calls this directly

Calls 2

fetchFunction · 0.90
textMethod · 0.45

Tested by

no test coverage detected