MCPcopy Create free account
hub / github.com/algolia/cli / TestInspectAPIKey_InvalidCredentials

Function TestInspectAPIKey_InvalidCredentials

pkg/cmd/profile/add/add_test.go:157–166  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

155}
156
157func TestInspectAPIKey_InvalidCredentials(t *testing.T) {
158 stub := &stubAPIKeyInspector{
159 listErr: errors.New("API error [403] invalid"), // fall back to GetApiKey
160 getErr: errors.New("API error [403] invalid"),
161 }
162
163 _, _, err := inspectAPIKey(stub, "bad-key")
164 require.Error(t, err)
165 assert.Equal(t, "invalid application credentials", err.Error())
166}

Callers

nothing calls this directly

Calls 2

inspectAPIKeyFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected