MCPcopy Create free account
hub / github.com/github/copilot-sdk / test_zero_param_handler

Method test_zero_param_handler

python/test_tools.py:107–127  ·  view source on GitHub ↗

Handler with no parameters: def handler() -> str

(self)

Source from the content-addressed store, hash-verified

105 assert received_inv.tool_call_id == "call-456"
106
107 async def test_zero_param_handler(self):
108 """Handler with no parameters: def handler() -> str"""
109 called = False
110
111 @define_tool("test", description="Test tool")
112 def test_tool() -> str:
113 nonlocal called
114 called = True
115 return "ok"
116
117 invocation = ToolInvocation(
118 session_id="s1",
119 tool_call_id="c1",
120 tool_name="test",
121 arguments={},
122 )
123
124 result = await test_tool.handler(invocation)
125
126 assert called
127 assert result.text_result_for_llm == "ok"
128
129 async def test_invocation_only_handler(self):
130 """Handler with only invocation: def handler(invocation) -> str"""

Callers

nothing calls this directly

Calls 2

ToolInvocationClass · 0.90
handlerMethod · 0.45

Tested by

no test coverage detected