()
| 95 | @pytest.mark.asyncio |
| 96 | @pytest.mark.flaky(reruns=3, reruns_delay=2) |
| 97 | async 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() |
nothing calls this directly
no test coverage detected