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

Function TestInspectAPIKey_AdminKeySkipsGetApiKey

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

Source from the content-addressed store, hash-verified

127}
128
129func TestInspectAPIKey_AdminKeySkipsGetApiKey(t *testing.T) {
130 stub := &stubAPIKeyInspector{
131 listErr: nil, // admin keys can list API keys
132 getErr: errors.New("should not be called"),
133 }
134
135 isAdmin, acls, err := inspectAPIKey(stub, "my-admin-key")
136 require.NoError(t, err)
137 assert.True(t, isAdmin)
138 assert.Nil(t, acls)
139 assert.False(t, stub.getCalled)
140}
141
142func TestInspectAPIKey_NonAdminKeyReturnsACLs(t *testing.T) {
143 stub := &stubAPIKeyInspector{

Callers

nothing calls this directly

Calls 1

inspectAPIKeyFunction · 0.85

Tested by

no test coverage detected