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

Function _make_agent_manager

tests/agents/test_group_store.py:24–47  ·  view source on GitHub ↗

Create a mock AgentManager with the given agent configs.

(*agent_configs)

Source from the content-addressed store, hash-verified

22
23
24def _make_agent_manager(*agent_configs):
25 """Create a mock AgentManager with the given agent configs."""
26 mgr = MagicMock()
27 snapshots = {}
28 statuses = []
29
30 for cfg in agent_configs:
31 ctx = MagicMock()
32 ctx.agent_id = cfg.agent_id
33 ctx.session_id = f"session-{cfg.agent_id}"
34 ctx.conversation_history = []
35 snapshots[cfg.agent_id] = {"config": cfg, "context": ctx}
36 statuses.append(
37 {
38 "agent_id": cfg.agent_id,
39 "name": cfg.name,
40 "role": cfg.role,
41 "status": "active",
42 }
43 )
44
45 mgr.list_agents.return_value = statuses
46 mgr.get_agent_snapshot.side_effect = lambda aid: snapshots.get(aid)
47 return mgr
48
49
50# ---------------------------------------------------------------------------

Callers 3

test_save_empty_groupMethod · 0.85
test_save_with_agentsMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected