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

Function TestSearchAPIDetailModeNotFound

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

Source from the content-addressed store, hash-verified

124}
125
126func TestSearchAPIDetailModeNotFound(t *testing.T) {
127 profile := &config.Profile{Mode: common.ReleaseModeDev}
128 s, err := NewServer(nil, profile, "test-secret")
129 require.NoError(t, err)
130
131 // Test detail mode with unknown operationId
132 result, _, err := s.handleSearchAPI(context.Background(), nil, SearchInput{
133 OperationID: "unknown.operation.id",
134 })
135 require.NoError(t, err)
136 require.NotNil(t, result)
137 require.Len(t, result.Content, 1)
138
139 text := result.Content[0].(*mcpsdk.TextContent).Text
140 require.Contains(t, text, "Unknown operationId")
141}
142
143func TestSearchAPIServiceShowsAll(t *testing.T) {
144 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