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

Function TestProtocol_CallTool_FormatSQL

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

Source from the content-addressed store, hash-verified

132}
133
134func TestProtocol_CallTool_FormatSQL(t *testing.T) {
135 c := newInProcessClient(t)
136 ctx := context.Background()
137
138 req := mcpmcp.CallToolRequest{}
139 req.Params.Name = "format_sql"
140 req.Params.Arguments = map[string]any{
141 "sql": "select id from users",
142 "uppercase_keywords": true,
143 }
144
145 result, err := c.CallTool(ctx, req)
146 if err != nil {
147 t.Fatalf("CallTool format_sql: %v", err)
148 }
149
150 data := extractProtocolResult(t, result)
151 if _, ok := data["formatted_sql"]; !ok {
152 t.Error("expected formatted_sql in response")
153 }
154}
155
156func TestProtocol_CallTool_ParseSQL(t *testing.T) {
157 c := newInProcessClient(t)

Callers

nothing calls this directly

Calls 4

newInProcessClientFunction · 0.85
extractProtocolResultFunction · 0.85
FatalfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected