(file: FileTypes)
| 61 | |
| 62 | |
| 63 | def _transform_file(file: FileTypes) -> HttpxFileTypes: |
| 64 | if is_file_content(file): |
| 65 | if isinstance(file, os.PathLike): |
| 66 | path = pathlib.Path(file) |
| 67 | return (path.name, path.read_bytes()) |
| 68 | |
| 69 | return file |
| 70 | |
| 71 | if is_tuple_t(file): |
| 72 | return (file[0], read_file_content(file[1]), *file[2:]) |
| 73 | |
| 74 | raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") |
| 75 | |
| 76 | |
| 77 | def read_file_content(file: FileContent) -> HttpxFileContent: |
no test coverage detected