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

Function _make_ctx

tests/chat/test_chat_handler_coverage.py:37–48  ·  view source on GitHub ↗

Build a mock ChatContext.

(exit_requested=False)

Source from the content-addressed store, hash-verified

35
36
37def _make_ctx(exit_requested=False):
38 """Build a mock ChatContext."""
39 ctx = MagicMock()
40 ctx.provider = "openai"
41 ctx.model = "gpt-4"
42 ctx.exit_requested = exit_requested
43 ctx.add_user_message = AsyncMock()
44 # Real staging so multi-modal processing works correctly (drain returns [])
45 from mcp_cli.chat.attachments import AttachmentStaging
46
47 ctx.attachment_staging = AttachmentStaging()
48 return ctx
49
50
51def _make_convo():

Calls 1

AttachmentStagingClass · 0.90

Tested by

no test coverage detected