MCPcopy Create free account
hub / github.com/docker/cli / TestNativeStoreGetAll

Function TestNativeStoreGetAll

cli/config/credentials/native_store_test.go:171–192  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

169}
170
171func TestNativeStoreGetAll(t *testing.T) {
172 f := &fakeStore{configs: map[string]types.AuthConfig{
173 validServerAddress: {},
174 }}
175
176 s := &nativeStore{
177 programFunc: mockCommandFn,
178 fileStore: NewFileStore(f),
179 }
180 as, err := s.GetAll()
181 assert.NilError(t, err)
182 assert.Check(t, is.Len(as, 2))
183 expected := types.AuthConfig{
184 Username: "foo",
185 Password: "bar",
186 ServerAddress: "https://index.docker.io/v1",
187 IdentityToken: "",
188 }
189 actual, ok := as[validServerAddress]
190 assert.Check(t, ok)
191 assert.Check(t, is.DeepEqual(expected, actual))
192}
193
194func TestNativeStoreGetMissingCredentials(t *testing.T) {
195 f := &fakeStore{configs: map[string]types.AuthConfig{

Callers

nothing calls this directly

Calls 3

GetAllMethod · 0.95
NewFileStoreFunction · 0.85
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…