StrictVerifier¶
StrictVerifier
¶
Central orchestrator: owns timeline, plugin registry, ContextVar routing.
Source code in src/bigfoot/_verifier.py
mock
¶
Create or retrieve a named MockProxy. Lazily creates MockPlugin.
If wraps is provided, method calls on the proxy with an empty queue are delegated to the wrapped object instead of raising UnmockedInteractionError. The interaction is still recorded.
Source code in src/bigfoot/_verifier.py
spy
¶
Syntactic sugar for mock(name, wraps=real).
Creates a MockProxy that always delegates to real, recording every call on the timeline without requiring mock configurations.
Source code in src/bigfoot/_verifier.py
assert_interaction
¶
Assert the next interaction matches source and expected fields.
Completeness enforcement: after matching by source_id, the interaction's plugin.assertable_fields() is called. Any field in the returned set that is absent from **expected raises MissingAssertionFieldsError immediately, before the field-value match check.
Source code in src/bigfoot/_verifier.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
in_any_order
¶
Context manager: assertions within block matched in any order.
IMPORTANT: in_any_order() relaxes ordering globally across ALL plugins. It is not possible to relax ordering for only one plugin type. Any assert_interaction() call within this block will match any unasserted interaction regardless of which plugin (mock or HTTP) recorded it.
Source code in src/bigfoot/_verifier.py
verify_all
¶
Run Enforcement 2 and 3. Called at teardown.