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

Function _make_context

tests/chat/test_ui_manager_coverage.py:19–55  ·  view source on GitHub ↗

Build a minimal mock context for ChatUIManager.

()

Source from the content-addressed store, hash-verified

17
18
19def _make_context():
20 """Build a minimal mock context for ChatUIManager."""
21 ctx = MagicMock()
22 ctx.provider = "openai"
23 ctx.model = "gpt-4"
24 ctx.exit_requested = False
25 ctx.tool_manager = MagicMock()
26 ctx.model_manager = MagicMock()
27 ctx.to_dict = MagicMock(
28 return_value={
29 "conversation_history": [],
30 "tools": [],
31 "internal_tools": [],
32 "client": MagicMock(),
33 "provider": "openai",
34 "model": "gpt-4",
35 "model_manager": MagicMock(),
36 "server_info": [],
37 "openai_tools": [],
38 "tool_name_mapping": {},
39 "exit_requested": False,
40 "tool_to_server_map": {},
41 "tool_manager": MagicMock(),
42 "session_id": "test-session",
43 }
44 )
45 ctx.get_status_summary = MagicMock(
46 return_value=MagicMock(
47 provider="openai",
48 model="gpt-4",
49 message_count=5,
50 tool_count=10,
51 server_count=2,
52 tool_execution_count=3,
53 )
54 )
55 return ctx
56
57
58@pytest.fixture

Callers 3

ui_managerFunction · 0.70
test_theme_lightMethod · 0.70
test_theme_minimalMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected