MockPlugin¶
MockPlugin
¶
Bases: BasePlugin
Core mock plugin: intercepts method calls on named proxy objects.
Source code in src/bigfoot/_mock_plugin.py
get_or_create_proxy
¶
Return an existing MockProxy for name, or create a new one.
If wraps is provided and a proxy already exists, update its wraps attribute (e.g., spy() called after mock()). If no proxy exists, create a new one with wraps set.
Source code in src/bigfoot/_mock_plugin.py
activate
¶
deactivate
¶
Reference-counted uninstall. Decrements _install_count, floored at 0.
matches
¶
Return True if all expected fields match the interaction's details.
Source code in src/bigfoot/_mock_plugin.py
format_interaction
¶
One-line description: '[MockPlugin] MockName.method_name'.
Source code in src/bigfoot/_mock_plugin.py
format_mock_hint
¶
Copy-pasteable code to configure a mock for this interaction.
Source code in src/bigfoot/_mock_plugin.py
format_unmocked_hint
¶
Copy-pasteable code snippet for mocking a call that had no side effect.
Source code in src/bigfoot/_mock_plugin.py
format_assert_hint
¶
Copy-pasteable code to assert this interaction.
Source code in src/bigfoot/_mock_plugin.py
assertable_fields
¶
Return the field names required in **expected when asserting a mock interaction.
get_unused_mocks
¶
Return MockConfig objects that are required=True and still in the queue (never consumed).
Source code in src/bigfoot/_mock_plugin.py
format_unused_mock_hint
¶
Hint for an unused mock: show registration traceback and how to suppress.