|
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,71 +31,100 @@ class MockerCore: |
30 | 31 | def call_count(self) -> int: ... |
31 | 32 | def register_uri( |
32 | 33 | self, |
33 | | - method: str, |
| 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 = ..., |
34 | 39 | status_code: int = ..., |
35 | 40 | text: str = ..., |
36 | 41 | headers: Optional[Dict[str, str]] = ..., |
37 | 42 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
38 | 43 | **kwargs: Any) -> Response: ... |
39 | 44 | def request( |
40 | 45 | self, |
41 | | - method: str, |
| 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 = ..., |
42 | 51 | status_code: int = ..., |
43 | 52 | text: str = ..., |
44 | 53 | headers: Optional[Dict[str, str]] = ..., |
45 | 54 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
46 | 55 | **kwargs: Any) -> Response: ... |
47 | 56 | def get( |
48 | 57 | self, |
49 | | - path: Union[str, Pattern[str]], |
| 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 = ..., |
50 | 62 | status_code: int = ..., |
51 | 63 | text: str = ..., |
52 | 64 | headers: Optional[Dict[str, str]] = ..., |
53 | 65 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
54 | 66 | **kwargs: Any) -> Response: ... |
55 | 67 | def head( |
56 | 68 | self, |
57 | | - path: Union[str, Pattern[str]], |
| 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 = ..., |
58 | 73 | status_code: int = ..., |
59 | 74 | text: str = ..., |
60 | 75 | headers: Optional[Dict[str, str]] = ..., |
61 | 76 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
62 | 77 | **kwargs: Any) -> Response: ... |
63 | 78 | def options( |
64 | 79 | self, |
65 | | - path: Union[str, Pattern[str]], |
| 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 = ..., |
66 | 84 | status_code: int = ..., |
67 | 85 | text: str = ..., |
68 | 86 | headers: Optional[Dict[str, str]] = ..., |
69 | 87 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
70 | 88 | **kwargs: Any) -> Response: ... |
71 | 89 | def post( |
72 | 90 | self, |
73 | | - path: Union[str, Pattern[str]], |
| 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 = ..., |
74 | 95 | status_code: int = ..., |
75 | 96 | text: str = ..., |
76 | 97 | headers: Optional[Dict[str, str]] = ..., |
77 | 98 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
78 | 99 | **kwargs: Any) -> Response: ... |
79 | 100 | def put( |
80 | 101 | self, |
81 | | - path: Union[str, Pattern[str]], |
| 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 = ..., |
82 | 106 | status_code: int = ..., |
83 | 107 | text: str = ..., |
84 | 108 | headers: Optional[Dict[str, str]] = ..., |
85 | 109 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
86 | 110 | **kwargs: Any) -> Response: ... |
87 | 111 | def patch( |
88 | 112 | self, |
89 | | - path: Union[str, Pattern[str]], |
| 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 = ..., |
90 | 117 | status_code: int = ..., |
91 | 118 | text: str = ..., |
92 | 119 | headers: Optional[Dict[str, str]] = ..., |
93 | 120 | additional_matcher: Optional[Callable[[_RequestObjectProxy], bool]] = ..., |
94 | 121 | **kwargs: Any) -> Response: ... |
95 | 122 | def delete( |
96 | 123 | self, |
97 | | - path: Union[str, Pattern[str]], |
| 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 = ..., |
98 | 128 | status_code: int = ..., |
99 | 129 | text: str = ..., |
100 | 130 | headers: Optional[Dict[str, str]] = ..., |
|
0 commit comments