Test passing file/stream into the UploadFile constructor without size
()
| 385 | |
| 386 | @pytest.mark.anyio |
| 387 | async def test_upload_file_without_size() -> None: |
| 388 | """Test passing file/stream into the UploadFile constructor without size""" |
| 389 | stream = io.BytesIO(b"data") |
| 390 | file = UploadFile(filename="file", file=stream) |
| 391 | assert await file.read() == b"data" |
| 392 | assert file.size is None |
| 393 | await file.write(b" and more data!") |
| 394 | assert await file.read() == b"" |
| 395 | assert file.size is None |
| 396 | await file.seek(0) |
| 397 | assert await file.read() == b"data and more data!" |
| 398 | |
| 399 | |
| 400 | @pytest.mark.anyio |
nothing calls this directly
no test coverage detected