(file: FileTypes)
| 105 | |
| 106 | |
| 107 | async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: |
| 108 | if is_file_content(file): |
| 109 | if isinstance(file, os.PathLike): |
| 110 | path = anyio.Path(file) |
| 111 | return (path.name, await path.read_bytes()) |
| 112 | |
| 113 | return file |
| 114 | |
| 115 | if is_tuple_t(file): |
| 116 | return (file[0], await async_read_file_content(file[1]), *file[2:]) |
| 117 | |
| 118 | raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") |
| 119 | |
| 120 | |
| 121 | async def async_read_file_content(file: FileContent) -> HttpxFileContent: |
no test coverage detected