MCPcopy Create free account
hub / github.com/bytebase/bytebase / TestSearchAPIDetailModeShortFormat

Function TestSearchAPIDetailModeShortFormat

backend/api/mcp/tool_search_test.go:90–107  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestSearchAPIDetailModeShortFormat(t *testing.T) {
91 profile := &config.Profile{Mode: common.ReleaseModeDev}
92 s, err := NewServer(nil, profile, "test-secret")
93 require.NoError(t, err)
94
95 // Test detail mode with short operationId format (Service/Method)
96 result, _, err := s.handleSearchAPI(context.Background(), nil, SearchInput{
97 OperationID: "SQLService/Query",
98 })
99 require.NoError(t, err)
100 require.NotNil(t, result)
101 require.Len(t, result.Content, 1)
102
103 text := result.Content[0].(*mcpsdk.TextContent).Text
104 require.Contains(t, text, "SQLService/Query")
105 require.Contains(t, text, "Request Body")
106 require.Contains(t, text, "```json")
107}
108
109func TestSearchAPIDetailModeWithResponse(t *testing.T) {
110 profile := &config.Profile{Mode: common.ReleaseModeDev}

Callers

nothing calls this directly

Calls 3

handleSearchAPIMethod · 0.95
LenMethod · 0.80
NewServerFunction · 0.70

Tested by

no test coverage detected