Return a ToolManager instance whose registry is replaced by DummyRegistry.
(monkeypatch)
| 44 | |
| 45 | @pytest.fixture |
| 46 | def manager(monkeypatch): |
| 47 | """Return a ToolManager instance whose registry is replaced by DummyRegistry.""" |
| 48 | tm = ToolManager(config_file="dummy", servers=[]) |
| 49 | |
| 50 | # Provide predictable data |
| 51 | dummy = DummyRegistry([("ns1", "t1"), ("ns2", "t2"), ("default", "t1")]) |
| 52 | dummy._meta[("ns1", "t1")] = DummyMeta( |
| 53 | "d1", |
| 54 | {"properties": {"a": {"type": "int"}}, "required": ["a"]}, |
| 55 | is_async=True, |
| 56 | tags={"x"}, |
| 57 | ) |
| 58 | dummy._meta[("ns2", "t2")] = DummyMeta("d2", {}, is_async=False, tags=set()) |
| 59 | |
| 60 | # Monkey‑patch in the dummy registry |
| 61 | monkeypatch.setattr(tm, "_registry", dummy) |
| 62 | return tm |
| 63 | |
| 64 | |
| 65 | # ---------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected