MCPcopy Index your code
hub / github.com/docker/cli / TestFileStoreAddCredentials

Function TestFileStoreAddCredentials

cli/config/credentials/file_store_test.go:104–120  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102}
103
104func TestFileStoreAddCredentials(t *testing.T) {
105 f := &fakeStore{configs: map[string]types.AuthConfig{}}
106
107 s := NewFileStore(f)
108 auth := types.AuthConfig{
109 Username: "foo@example.com",
110 Auth: "super_secret_token",
111 ServerAddress: "https://example.com",
112 }
113 err := s.Store(auth)
114 assert.NilError(t, err)
115 assert.Check(t, is.Len(f.GetAuthConfigs(), 1))
116
117 actual, ok := f.GetAuthConfigs()["https://example.com"]
118 assert.Check(t, ok)
119 assert.Check(t, is.DeepEqual(auth, actual))
120}
121
122func TestFileStoreGet(t *testing.T) {
123 f := &fakeStore{configs: map[string]types.AuthConfig{

Callers

nothing calls this directly

Calls 4

GetAuthConfigsMethod · 0.95
NewFileStoreFunction · 0.85
StoreMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…