massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 3 / unittest / mock.pyi
1 # Stubs for mock\r
2 \r
3 import sys\r
4 from typing import Any, Optional, Text, Type\r
5 \r
6 FILTER_DIR = ...  # type: Any\r
7 \r
8 class _slotted: ...\r
9 \r
10 class _SentinelObject:\r
11     name = ...  # type: Any\r
12     def __init__(self, name: Any) -> None: ...\r
13 \r
14 class _Sentinel:\r
15     def __init__(self) -> None: ...\r
16     def __getattr__(self, name: str) -> Any: ...\r
17 \r
18 sentinel = ...  # type: Any\r
19 DEFAULT = ...  # type: Any\r
20 \r
21 class _CallList(list):\r
22     def __contains__(self, value: Any) -> bool: ...\r
23 \r
24 class _MockIter:\r
25     obj = ...  # type: Any\r
26     def __init__(self, obj: Any) -> None: ...\r
27     def __iter__(self) -> Any: ...\r
28     def __next__(self) -> Any: ...\r
29 \r
30 class Base:\r
31     def __init__(self, *args: Any, **kwargs: Any) -> None: ...\r
32 \r
33 # TODO: Defining this and other mock classes as classes in this stub causes\r
34 #       many false positives with mypy and production code. See if we can\r
35 #       improve mypy somehow and use a class with an "Any" base class.\r
36 NonCallableMock: Any\r
37 \r
38 class CallableMixin(Base):\r
39     side_effect = ...  # type: Any\r
40     def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ...\r
41     def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ...\r
42 \r
43 Mock: Any\r
44 \r
45 class _patch:\r
46     attribute_name = ...  # type: Any\r
47     getter = ...  # type: Any\r
48     attribute = ...  # type: Any\r
49     new = ...  # type: Any\r
50     new_callable = ...  # type: Any\r
51     spec = ...  # type: Any\r
52     create = ...  # type: bool\r
53     has_local = ...  # type: Any\r
54     spec_set = ...  # type: Any\r
55     autospec = ...  # type: Any\r
56     kwargs = ...  # type: Any\r
57     additional_patchers = ...  # type: Any\r
58     def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ...\r
59     def copy(self) -> Any: ...\r
60     def __call__(self, func: Any) -> Any: ...\r
61     def decorate_class(self, klass: Any) -> Any: ...\r
62     def decorate_callable(self, func: Any) -> Any: ...\r
63     def get_original(self) -> Any: ...\r
64     target = ...  # type: Any\r
65     temp_original = ...  # type: Any\r
66     is_local = ...  # type: Any\r
67     def __enter__(self) -> Any: ...\r
68     def __exit__(self, *exc_info: Any) -> Any: ...\r
69     def start(self) -> Any: ...\r
70     def stop(self) -> Any: ...\r
71 \r
72 class _patch_dict:\r
73     in_dict = ...  # type: Any\r
74     values = ...  # type: Any\r
75     clear = ...  # type: Any\r
76     def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ...\r
77     def __call__(self, f: Any) -> Any: ...\r
78     def decorate_class(self, klass: Any) -> Any: ...\r
79     def __enter__(self) -> Any: ...\r
80     def __exit__(self, *args: Any) -> Any: ...\r
81     start = ...  # type: Any\r
82     stop = ...  # type: Any\r
83 \r
84 class _patcher:\r
85     TEST_PREFIX = ...  # type: str\r
86     dict = ...  # type: Type[_patch_dict]\r
87     def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> Any: ...\r
88     def object(self, target: Any, attribute: Text, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ...\r
89     def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> Any: ...\r
90     def stopall(self) -> None: ...\r
91 \r
92 patch = ...  # type: _patcher\r
93 \r
94 class MagicMixin:\r
95     def __init__(self, *args: Any, **kw: Any) -> None: ...\r
96 \r
97 NonCallableMagicMock: Any\r
98 MagicMock: Any\r
99 \r
100 class MagicProxy:\r
101     name = ...  # type: Any\r
102     parent = ...  # type: Any\r
103     def __init__(self, name: Any, parent: Any) -> None: ...\r
104     def __call__(self, *args: Any, **kwargs: Any) -> Any: ...\r
105     def create_mock(self) -> Any: ...\r
106     def __get__(self, obj: Any, _type: Optional[Any] = ...) -> Any: ...\r
107 \r
108 class _ANY:\r
109     def __eq__(self, other: Any) -> bool: ...\r
110     def __ne__(self, other: Any) -> bool: ...\r
111 \r
112 ANY = ...  # type: Any\r
113 \r
114 class _Call(tuple):\r
115     def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ...\r
116     name = ...  # type: Any\r
117     parent = ...  # type: Any\r
118     from_kall = ...  # type: Any\r
119     def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ...\r
120     def __eq__(self, other: Any) -> bool: ...\r
121     __ne__ = ...  # type: Any\r
122     def __call__(self, *args: Any, **kwargs: Any) -> Any: ...\r
123     def __getattr__(self, attr: Any) -> Any: ...\r
124     def count(self, *args: Any, **kwargs: Any) -> Any: ...\r
125     def index(self, *args: Any, **kwargs: Any) -> Any: ...\r
126     def call_list(self) -> Any: ...\r
127 \r
128 call = ...  # type: Any\r
129 \r
130 def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ...\r
131 \r
132 class _SpecState:\r
133     spec = ...  # type: Any\r
134     ids = ...  # type: Any\r
135     spec_set = ...  # type: Any\r
136     parent = ...  # type: Any\r
137     instance = ...  # type: Any\r
138     name = ...  # type: Any\r
139     def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ...\r
140 \r
141 def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ...\r
142 \r
143 PropertyMock: Any\r
144 \r
145 if sys.version_info >= (3, 7):\r
146     def seal(mock: Any) -> None: ...\r