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

Function TestQueryDatabase_SubstringMatch

backend/api/mcp/tool_query_test.go:249–259  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

247}
248
249func TestQueryDatabase_SubstringMatch(t *testing.T) {
250 databases := []map[string]any{
251 makeDatabase("instances/prod-pg/databases/employee_db", "instances/prod-pg", "projects/hr-system", "POSTGRES", "ds-admin-1"),
252 }
253 s := newTestServerWithMock(t, mockListDatabases(databases))
254
255 resolved, err := s.resolveDatabase(testContext(), "employee", "", "")
256 require.NoError(t, err)
257 require.False(t, resolved.ambiguous)
258 require.Equal(t, "instances/prod-pg/databases/employee_db", resolved.resourceName)
259}
260
261func TestQueryDatabase_NotFound(t *testing.T) {
262 databases := []map[string]any{

Callers

nothing calls this directly

Calls 6

newTestServerWithMockFunction · 0.85
mockListDatabasesFunction · 0.85
testContextFunction · 0.85
resolveDatabaseMethod · 0.80
makeDatabaseFunction · 0.70
EqualMethod · 0.65

Tested by

no test coverage detected