Skip to content

Commit

Permalink
Import _Files type from requests library
Browse files Browse the repository at this point in the history
  • Loading branch information
semperos committed Dec 13, 2024
1 parent 80a5d2e commit 2e11569
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions responses/matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from json.decoder import JSONDecodeError
from typing import Any
from typing import Callable
from typing import Iterable
from typing import List
from typing import Mapping
from typing import MutableMapping
Expand All @@ -16,6 +15,7 @@
from urllib.parse import urlparse

from requests import PreparedRequest
from requests.sessions import _Files
from urllib3.util.url import parse_url


Expand Down Expand Up @@ -276,17 +276,6 @@ def match(request: PreparedRequest) -> Tuple[bool, str]:
return match


_FileName = Optional[str]
_FileContent = Union[str, bytes]
_FileContentType = str
_FileCustomHeaders = Mapping[str, str]
_FileSpecTuple2 = tuple[_FileName, _FileContent]
_FileSpecTuple3 = tuple[_FileName, _FileContent, _FileContentType]
_FileSpecTuple4 = tuple[_FileName, _FileContent, _FileContentType, _FileCustomHeaders]
_FileSpec = Union[_FileContent, _FileSpecTuple2, _FileSpecTuple3, _FileSpecTuple4]
_Files = Union[Mapping[str, _FileSpec], Iterable[tuple[str, _FileSpec]]]


def multipart_matcher(
files: _Files, data: Optional[Mapping[str, str]] = None
) -> Callable[..., Any]:
Expand Down

0 comments on commit 2e11569

Please sign in to comment.