MCPcopy Index your code
hub / github.com/RustPython/RustPython / mock_add_spec

Method mock_add_spec

Lib/unittest/mock.py:524–530  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

522
523
524 def mock_add_spec(self, spec, spec_set=False):
525 """Add a spec to a mock. `spec` can either be an object or a
526 list of strings. Only attributes on the `spec` can be fetched as
527 attributes from the mock.
528
529 If `spec_set` is True then only attributes on the spec can be set."""
530 self._mock_add_spec(spec, spec_set)
531
532
533 def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,

Callers

nothing calls this directly

Calls 1

_mock_add_specMethod · 0.95

Tested by

no test coverage detected