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