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

Function test_send_async_bytes_stream

tests/request_test.py:80–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78@pytest.mark.asyncio
79@pytest.mark.flaky(reruns=3, reruns_delay=2)
80async def test_send_async_bytes_stream():
81 async def file_bytes_stream():
82 with open("README.md", "rb") as f:
83 while True:
84 chunk = f.read(1024)
85 if not chunk:
86 break
87 yield chunk
88
89 url = "https://httpbin.org/post"
90 response = await client.post(url, body=file_bytes_stream())
91 json = await response.json()
92 assert json["data"] in open("README.md").read()
93
94
95@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

file_bytes_streamFunction · 0.85
postMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected