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

Function TestFileStoreErase

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

Source from the content-addressed store, hash-verified

180}
181
182func TestFileStoreErase(t *testing.T) {
183 f := &fakeStore{configs: map[string]types.AuthConfig{
184 "https://example.com": {
185 Username: "foo@example.com",
186 Auth: "super_secret_token",
187 ServerAddress: "https://example.com",
188 },
189 }}
190
191 s := NewFileStore(f)
192 err := s.Erase("https://example.com")
193 if err != nil {
194 t.Fatal(err)
195 }
196
197 // file store never returns errors, check that the auth config is empty
198 a, err := s.Get("https://example.com")
199 if err != nil {
200 t.Fatal(err)
201 }
202
203 if a.Auth != "" {
204 t.Fatalf("expected empty auth token, got %s", a.Auth)
205 }
206}
207
208func TestConvertToHostname(t *testing.T) {
209 tests := []struct{ input, expected string }{

Callers

nothing calls this directly

Calls 3

NewFileStoreFunction · 0.85
EraseMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…