MCPcopy Create free account
hub / github.com/docker/secrets-engine / TestKeychainGetNotFound

Function TestKeychainGetNotFound

store/keychain/keychain_linux_test.go:205–212  ·  view source on GitHub ↗

TestKeychainGetNotFound exercises the full Get path against the fake — open, resolve collection, search — and asserts an empty search maps to ErrCredentialNotFound, all without a live keyring.

(t *testing.T)

Source from the content-addressed store, hash-verified

203// resolve collection, search — and asserts an empty search maps to
204// ErrCredentialNotFound, all without a live keyring.
205func TestKeychainGetNotFound(t *testing.T) {
206 fake := &fakeService{} // no items -> not found
207 withFakeService(t, fake)
208
209 ks := setupKeychain(t, nil)
210 _, err := ks.Get(t.Context(), store.MustParseID("com.test.test/test/missing"))
211 assert.ErrorIs(t, err, store.ErrCredentialNotFound)
212}
213
214// TestKeychainGetAllMetadataEmpty is a regression test for `docker pass ls`
215// against an empty keychain: listing all is a valid empty result, not a miss,

Callers

nothing calls this directly

Calls 3

withFakeServiceFunction · 0.85
setupKeychainFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected