Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock. If `spec_set` is True then only attributes on the spec can be set.
(self, spec, spec_set=False)
| 2202 | class NonCallableMagicMock(MagicMixin, NonCallableMock): |
| 2203 | """A version of `MagicMock` that isn't callable.""" |
| 2204 | def mock_add_spec(self, spec, spec_set=False): |
| 2205 | """Add a spec to a mock. `spec` can either be an object or a |
| 2206 | list of strings. Only attributes on the `spec` can be fetched as |
| 2207 | attributes from the mock. |
| 2208 | |
| 2209 | If `spec_set` is True then only attributes on the spec can be set.""" |
| 2210 | self._mock_add_spec(spec, spec_set) |
| 2211 | self._mock_set_magics() |
| 2212 | |
| 2213 | |
| 2214 | class AsyncMagicMixin(MagicMixin): |
nothing calls this directly
no test coverage detected