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

Function mockMetadataServer

backend/api/mcp/tool_schema_test.go:171–175  ·  view source on GitHub ↗

mockMetadataServer returns a ready-to-use mock server that handles both ListDatabases and GetDatabaseMetadata calls.

(t *testing.T, databases []map[string]any, responses ...map[string]any)

Source from the content-addressed store, hash-verified

169// mockMetadataServer returns a ready-to-use mock server that handles both
170// ListDatabases and GetDatabaseMetadata calls.
171func mockMetadataServer(t *testing.T, databases []map[string]any, responses ...map[string]any) (*Server, *metadataMock) {
172 t.Helper()
173 mock := newMetadataMock(databases, responses...)
174 return newTestServerWithMock(t, mock.handler()), mock
175}
176
177// employeeDB returns a standard single-database fixture (POSTGRES, employee_db).
178func employeeDB() []map[string]any {

Calls 3

newMetadataMockFunction · 0.85
newTestServerWithMockFunction · 0.85
handlerMethod · 0.45

Tested by

no test coverage detected