MCPcopy Create free account
hub / github.com/IBM/mcp-cli / manager

Function manager

tests/tools/test_tool_manager.py:46–62  ·  view source on GitHub ↗

Return a ToolManager instance whose registry is replaced by DummyRegistry.

(monkeypatch)

Source from the content-addressed store, hash-verified

44
45@pytest.fixture
46def 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# ----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

ToolManagerClass · 0.90
DummyRegistryClass · 0.85
DummyMetaClass · 0.85

Tested by

no test coverage detected