Test passing file/stream into the UploadFile constructor without size
()
| 437 | |
| 438 | @pytest.mark.anyio |
| 439 | async def test_upload_file_without_size() -> None: |
| 440 | """Test passing file/stream into the UploadFile constructor without size""" |
| 441 | stream = io.BytesIO(b"data") |
| 442 | file = UploadFile(filename="file", file=stream) |
| 443 | assert await file.read() == b"data" |
| 444 | assert file.size is None |
| 445 | await file.write(b" and more data!") |
| 446 | assert await file.read() == b"" |
| 447 | assert file.size is None |
| 448 | await file.seek(0) |
| 449 | assert await file.read() == b"data and more data!" |
| 450 | |
| 451 | |
| 452 | @pytest.mark.anyio |
nothing calls this directly
no test coverage detected