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

Function test_fetch_bytearray

core/tests/python/tests/test_fetch.py:57–68  ·  view source on GitHub ↗

The fetch function should return the expected bytearray response.

()

Source from the content-addressed store, hash-verified

55
56
57async def test_fetch_bytearray():
58 """
59 The fetch function should return the expected bytearray response.
60 """
61 response = await fetch("https://jsonplaceholder.typicode.com/todos/1")
62 assert response.ok
63 data = await response.bytearray()
64 assert isinstance(data, bytearray)
65 assert b"delectus aut autem" in data
66 assert b"completed" in data
67 assert b"false" in data
68 assert b"1" in data
69
70
71async def test_fetch_bytearray_direct():

Callers

nothing calls this directly

Calls 2

fetchFunction · 0.90
bytearrayMethod · 0.45

Tested by

no test coverage detected