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

Function test_initialize_chat_context

tests/chat/test_chat_context.py:140–155  ·  view source on GitHub ↗
(chat_context)

Source from the content-addressed store, hash-verified

138# ---------------------------------------------------------------------------
139@pytest.mark.asyncio
140async def test_initialize_chat_context(chat_context):
141 ok = await chat_context.initialize()
142 assert ok is True
143
144 # tools discovered
145 assert chat_context.get_tool_count() == 2
146
147 # system prompt injected as first conversation turn
148 assert chat_context.conversation_history[0].to_dict() == {
149 "role": "system",
150 "content": "SYS_PROMPT",
151 }
152
153 # OpenAI tools adapted
154 assert len(chat_context.openai_tools) == 2
155 assert chat_context.tool_name_mapping # non-empty
156
157
158@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

get_tool_countMethod · 0.80
initializeMethod · 0.45
to_dictMethod · 0.45

Tested by

no test coverage detected