A version of `MagicMock` that isn't callable.
| 2207 | |
| 2208 | |
| 2209 | class NonCallableMagicMock(MagicMixin, NonCallableMock): |
| 2210 | """A version of `MagicMock` that isn't callable.""" |
| 2211 | def mock_add_spec(self, spec, spec_set=False): |
| 2212 | """Add a spec to a mock. `spec` can either be an object or a |
| 2213 | list of strings. Only attributes on the `spec` can be fetched as |
| 2214 | attributes from the mock. |
| 2215 | |
| 2216 | If `spec_set` is True then only attributes on the spec can be set.""" |
| 2217 | self._mock_add_spec(spec, spec_set) |
| 2218 | self._mock_set_magics() |
| 2219 | |
| 2220 | |
| 2221 | class AsyncMagicMixin(MagicMixin): |
no outgoing calls
searching dependent graphs…