Skip to content

Commit 8282d3b

Browse files
authored
Add upsert to mypy stubs (#372)
1 parent 736fd0e commit 8282d3b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

responses/__init__.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,22 @@ class _Replace(Protocol):
235235
match: List[Any] = ...,
236236
) -> None: ...
237237

238+
class _Upsert(Protocol):
239+
def __call__(
240+
self,
241+
method: Optional[Union[str, BaseResponse]] = ...,
242+
url: Optional[Union[Pattern[str], str]] = ...,
243+
body: _Body = ...,
244+
json: Optional[Any] = ...,
245+
status: int = ...,
246+
headers: Optional[Mapping[str, str]] = ...,
247+
stream: bool = ...,
248+
content_type: Optional[str] = ...,
249+
adding_headers: Optional[Mapping[str, str]] = ...,
250+
match_querystring: bool = ...,
251+
match: List[Any] = ...,
252+
) -> None: ...
253+
238254
activate: _Activate
239255
add: _Add
240256
add_callback: _AddCallback
@@ -259,6 +275,7 @@ response_callback: Callable[[Any], Any]
259275
start: Callable[[], None]
260276
stop: Callable[..., None]
261277
target: Any
278+
upsert: _Upsert
262279

263280
__all__ = [
264281
"CallbackResponse",
@@ -287,4 +304,5 @@ __all__ = [
287304
"start",
288305
"stop",
289306
"target",
307+
"upsert"
290308
]

0 commit comments

Comments
 (0)