MCPcopy Create free account
hub / github.com/idank/explainshell / _FakeExtractor

Class _FakeExtractor

tests/extraction/test_runner.py:50–63  ·  view source on GitHub ↗

Fake that satisfies BatchExtractor for isinstance checks. Uses MagicMock for method bodies so tests can inspect calls and set side_effects. All attributes are per-instance, avoiding the class-level mutation that PropertyMock on MagicMock causes.

Source from the content-addressed store, hash-verified

48
49
50class _FakeExtractor:
51 """Fake that satisfies BatchExtractor for isinstance checks.
52
53 Uses MagicMock for method bodies so tests can inspect calls and set
54 side_effects. All attributes are per-instance, avoiding the class-level
55 mutation that PropertyMock on MagicMock causes.
56 """
57
58 def __init__(self) -> None:
59 self.extract = MagicMock()
60 self.prepare = MagicMock()
61 self.finalize = MagicMock()
62 self.batch_provider = MagicMock()
63 self.cancel = MagicMock()
64
65
66def _make_extractor(

Calls

no outgoing calls