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

Function TestSearchAPISchemaLookupNotFound

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

Source from the content-addressed store, hash-verified

197}
198
199func TestSearchAPISchemaLookupNotFound(t *testing.T) {
200 profile := &config.Profile{Mode: common.ReleaseModeDev}
201 s, err := NewServer(nil, profile, "test-secret")
202 require.NoError(t, err)
203
204 // Test schema lookup with unknown name
205 result, _, err := s.handleSearchAPI(context.Background(), nil, SearchInput{
206 Schema: "NonExistentSchema",
207 })
208 require.NoError(t, err)
209 require.NotNil(t, result)
210 require.Len(t, result.Content, 1)
211
212 text := result.Content[0].(*mcpsdk.TextContent).Text
213 require.Contains(t, text, "Unknown schema")
214}
215
216func TestSearchAPISchemaLookupEnum(t *testing.T) {
217 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