(t *testing.T)
| 1211 | } |
| 1212 | |
| 1213 | func 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 | |
| 1230 | func TestServerToolHandlerPanicOnNil(t *testing.T) { |
| 1231 | tool := ServerTool{ |
nothing calls this directly
no test coverage detected