MCPcopy Index your code
hub / github.com/github/github-mcp-server / TestServerToolHasHandler

Function TestServerToolHasHandler

pkg/inventory/registry_test.go:1213–1228  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1211}
1212
1213func TestServerToolHasHandler(t *testing.T) {
1214 // Tool with handler
1215 toolWithHandler := mockTool("has_handler", "toolset1", true)
1216 if !toolWithHandler.HasHandler() {
1217 t.Error("Expected HasHandler() to return true for tool with handler")
1218 }
1219
1220 // Tool without handler
1221 toolWithoutHandler := ServerTool{
1222 Tool: mcp.Tool{Name: "no_handler"},
1223 Toolset: testToolsetMetadata("toolset1"),
1224 }
1225 if toolWithoutHandler.HasHandler() {
1226 t.Error("Expected HasHandler() to return false for tool without handler")
1227 }
1228}
1229
1230func TestServerToolHandlerPanicOnNil(t *testing.T) {
1231 tool := ServerTool{

Callers

nothing calls this directly

Calls 4

HasHandlerMethod · 0.95
testToolsetMetadataFunction · 0.85
mockToolFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected