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

Function TestGetProjectIDQueryHistoryID

backend/common/resource_name_test.go:19–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestGetProjectIDQueryHistoryID(t *testing.T) {
20 projectID, historyID, err := GetProjectIDQueryHistoryID("projects/p1/queryHistories/550e8400-e29b-41d4-a716-446655440000")
21 require.NoError(t, err)
22 require.Equal(t, "p1", projectID)
23 require.Equal(t, "550e8400-e29b-41d4-a716-446655440000", historyID)
24
25 _, _, err = GetProjectIDQueryHistoryID("projects/p1/queryHistories")
26 require.Error(t, err)
27
28 _, _, err = GetProjectIDQueryHistoryID("queryHistories/h1")
29 require.Error(t, err)
30}

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected