MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestProtocol_CallTool_AnalyzeSQL

Function TestProtocol_CallTool_AnalyzeSQL

pkg/mcp/protocol_test.go:235–254  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

233}
234
235func TestProtocol_CallTool_AnalyzeSQL(t *testing.T) {
236 c := newInProcessClient(t)
237 ctx := context.Background()
238
239 req := mcpmcp.CallToolRequest{}
240 req.Params.Name = "analyze_sql"
241 req.Params.Arguments = map[string]any{"sql": "SELECT id, name FROM users WHERE active = true"}
242
243 result, err := c.CallTool(ctx, req)
244 if err != nil {
245 t.Fatalf("CallTool analyze_sql: %v", err)
246 }
247
248 data := extractProtocolResult(t, result)
249 for _, key := range []string{"validate", "parse", "metadata", "security", "lint", "format"} {
250 if _, ok := data[key]; !ok {
251 t.Errorf("missing sub-result %q in analyze response", key)
252 }
253 }
254}
255
256// --- Error Handling ---
257

Callers

nothing calls this directly

Calls 4

newInProcessClientFunction · 0.85
extractProtocolResultFunction · 0.85
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected