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

Function TestGetSchema_DatabaseNotFound

backend/api/mcp/tool_schema_test.go:664–675  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

662}
663
664func TestGetSchema_DatabaseNotFound(t *testing.T) {
665 s := newTestServerWithMock(t, mockListDatabases(employeeDB()))
666
667 result, _, err := s.handleGetSchema(testContext(), nil, SchemaInput{
668 Database: "nonexistent",
669 })
670 require.NoError(t, err)
671 require.True(t, result.IsError)
672
673 text := result.Content[0].(*mcpsdk.TextContent).Text
674 require.Contains(t, text, "DATABASE_NOT_FOUND")
675}
676
677func TestGetSchema_AmbiguousDatabase(t *testing.T) {
678 databases := []map[string]any{

Callers

nothing calls this directly

Calls 5

newTestServerWithMockFunction · 0.85
mockListDatabasesFunction · 0.85
employeeDBFunction · 0.85
testContextFunction · 0.85
handleGetSchemaMethod · 0.80

Tested by

no test coverage detected