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

Function file_to_bytes_stream

tests/request_test.py:98–101  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

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"))

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected