|
1 | 1 | # Stubs for requests_mock.mocker |
2 | 2 |
|
| 3 | +from requests_mock.adapter import AnyMatcher |
3 | 4 | from requests import Response |
4 | 5 | from requests_mock.request import _RequestObjectProxy |
5 | 6 | from typing import Any, Callable, Dict, List, Optional, Pattern, Type, TypeVar, Union |
@@ -30,73 +31,100 @@ class MockerCore: |
30 | 31 | def call_count(self) -> int: ... |
31 | 32 | def register_uri( |
32 | 33 | self, |
33 | | - method: Union[str, Any], |
34 | | - url: Union[str, Pattern[str], Any], |
| 34 | + method: Union[str, AnyMatcher], |
| 35 | + url: Union[str, Pattern[str], AnyMatcher], |
| 36 | + response_list: Optional[List[Dict[str, Any]]] = ..., |
| 37 | + request_headers: Dict[str, str] = ..., |
| 38 | + complete_qs: bool = ..., |
35 | 39 | status_code: int = ..., |
36 | 40 | text: str = ..., |
37 | 41 | headers: Optional[Dict[str, str]] = ..., |
38 | 42 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
39 | 43 | **kwargs: Any) -> Response: ... |
40 | 44 | def request( |
41 | 45 | self, |
42 | | - method: Union[str, Any], |
43 | | - url: Union[str, Pattern[str], Any], |
| 46 | + method: Union[str, AnyMatcher], |
| 47 | + url: Union[str, Pattern[str], AnyMatcher], |
| 48 | + response_list: Optional[List[Dict[str, Any]]] = ..., |
| 49 | + request_headers: Dict[str, str] = ..., |
| 50 | + complete_qs: bool = ..., |
44 | 51 | status_code: int = ..., |
45 | 52 | text: str = ..., |
46 | 53 | headers: Optional[Dict[str, str]] = ..., |
47 | 54 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
48 | 55 | **kwargs: Any) -> Response: ... |
49 | 56 | def get( |
50 | 57 | self, |
51 | | - url: Union[str, Pattern[str], Any], |
| 58 | + url: Union[str, Pattern[str], AnyMatcher], |
| 59 | + response_list: Optional[List[Dict[str, Any]]] = ..., |
| 60 | + request_headers: Dict[str, str] = ..., |
| 61 | + complete_qs: bool = ..., |
52 | 62 | status_code: int = ..., |
53 | 63 | text: str = ..., |
54 | 64 | headers: Optional[Dict[str, str]] = ..., |
55 | 65 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
56 | 66 | **kwargs: Any) -> Response: ... |
57 | 67 | def head( |
58 | 68 | self, |
59 | | - url: Union[str, Pattern[str], Any], |
| 69 | + url: Union[str, Pattern[str], AnyMatcher], |
| 70 | + response_list: Optional[List[Dict[str, Any]]] = ..., |
| 71 | + request_headers: Dict[str, str] = ..., |
| 72 | + complete_qs: bool = ..., |
60 | 73 | status_code: int = ..., |
61 | 74 | text: str = ..., |
62 | 75 | headers: Optional[Dict[str, str]] = ..., |
63 | 76 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
64 | 77 | **kwargs: Any) -> Response: ... |
65 | 78 | def options( |
66 | 79 | self, |
67 | | - url: Union[str, Pattern[str], Any], |
| 80 | + url: Union[str, Pattern[str], AnyMatcher], |
| 81 | + response_list: Optional[List[Dict[str, Any]]] = ..., |
| 82 | + request_headers: Dict[str, str] = ..., |
| 83 | + complete_qs: bool = ..., |
68 | 84 | status_code: int = ..., |
69 | 85 | text: str = ..., |
70 | 86 | headers: Optional[Dict[str, str]] = ..., |
71 | 87 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
72 | 88 | **kwargs: Any) -> Response: ... |
73 | 89 | def post( |
74 | 90 | self, |
75 | | - url: Union[str, Pattern[str], Any], |
| 91 | + url: Union[str, Pattern[str], AnyMatcher], |
| 92 | + response_list: Optional[List[Dict[str, Any]]] = ..., |
| 93 | + request_headers: Dict[str, str] = ..., |
| 94 | + complete_qs: bool = ..., |
76 | 95 | status_code: int = ..., |
77 | 96 | text: str = ..., |
78 | 97 | headers: Optional[Dict[str, str]] = ..., |
79 | 98 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
80 | 99 | **kwargs: Any) -> Response: ... |
81 | 100 | def put( |
82 | 101 | self, |
83 | | - url: Union[str, Pattern[str], Any], |
| 102 | + url: Union[str, Pattern[str], AnyMatcher], |
| 103 | + response_list: Optional[List[Dict[str, Any]]] = ..., |
| 104 | + request_headers: Dict[str, str] = ..., |
| 105 | + complete_qs: bool = ..., |
84 | 106 | status_code: int = ..., |
85 | 107 | text: str = ..., |
86 | 108 | headers: Optional[Dict[str, str]] = ..., |
87 | 109 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
88 | 110 | **kwargs: Any) -> Response: ... |
89 | 111 | def patch( |
90 | 112 | self, |
91 | | - url: Union[str, Pattern[str], Any], |
| 113 | + url: Union[str, Pattern[str], AnyMatcher], |
| 114 | + response_list: Optional[List[Dict[str, Any]]] = ..., |
| 115 | + request_headers: Dict[str, str] = ..., |
| 116 | + complete_qs: bool = ..., |
92 | 117 | status_code: int = ..., |
93 | 118 | text: str = ..., |
94 | 119 | headers: Optional[Dict[str, str]] = ..., |
95 | 120 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
96 | 121 | **kwargs: Any) -> Response: ... |
97 | 122 | def delete( |
98 | 123 | self, |
99 | | - url: Union[str, Pattern[str], Any], |
| 124 | + url: Union[str, Pattern[str], AnyMatcher], |
| 125 | + response_list: Optional[List[Dict[str, Any]]] = ..., |
| 126 | + request_headers: Dict[str, str] = ..., |
| 127 | + complete_qs: bool = ..., |
100 | 128 | status_code: int = ..., |
101 | 129 | text: str = ..., |
102 | 130 | headers: Optional[Dict[str, str]] = ..., |
|
0 commit comments