MCPcopy Create free account
hub / github.com/0x676e67/wreq-python / test_send_sync_bytes_stream

Function test_send_sync_bytes_stream

tests/request_test.py:97–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95@pytest.mark.asyncio
96@pytest.mark.flaky(reruns=3, reruns_delay=2)
97async def test_send_sync_bytes_stream():
98 def file_to_bytes_stream(file_path):
99 with open(file_path, "rb") as f:
100 while chunk := f.read(1024):
101 yield chunk
102
103 url = "https://httpbin.org/post"
104 response = await client.post(url, body=file_to_bytes_stream("README.md"))
105 json = await response.json()
106 assert json["data"] in open("README.md").read()

Callers

nothing calls this directly

Calls 3

file_to_bytes_streamFunction · 0.70
postMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected