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

Function test_fetch_array_buffer

core/tests/python/tests/test_fetch.py:80–91  ·  view source on GitHub ↗

The fetch function should return the expected array buffer response.

()

Source from the content-addressed store, hash-verified

78
79
80async def test_fetch_array_buffer():
81 """
82 The fetch function should return the expected array buffer response.
83 """
84 response = await fetch("https://jsonplaceholder.typicode.com/todos/1")
85 assert response.ok
86 data = await response.arrayBuffer()
87 bytes_ = bytes(data)
88 assert b"delectus aut autem" in bytes_
89 assert b"completed" in bytes_
90 assert b"false" in bytes_
91 assert b"1" in bytes_
92
93
94async def test_fetch_array_buffer_direct():

Callers

nothing calls this directly

Calls 2

fetchFunction · 0.90
arrayBufferMethod · 0.45

Tested by

no test coverage detected