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

Function TestProtocol_CallTool_ValidateSQL

pkg/mcp/protocol_test.go:115–132  ·  view source on GitHub ↗

--- Tool Calls ---

(t *testing.T)

Source from the content-addressed store, hash-verified

113// --- Tool Calls ---
114
115func TestProtocol_CallTool_ValidateSQL(t *testing.T) {
116 c := newInProcessClient(t)
117 ctx := context.Background()
118
119 req := mcpmcp.CallToolRequest{}
120 req.Params.Name = "validate_sql"
121 req.Params.Arguments = map[string]any{"sql": "SELECT id FROM users"}
122
123 result, err := c.CallTool(ctx, req)
124 if err != nil {
125 t.Fatalf("CallTool validate_sql: %v", err)
126 }
127
128 data := extractProtocolResult(t, result)
129 if data["valid"] != true {
130 t.Errorf("expected valid=true, got %v", data["valid"])
131 }
132}
133
134func TestProtocol_CallTool_FormatSQL(t *testing.T) {
135 c := newInProcessClient(t)

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