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

Function TestFileStoreGet

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

Source from the content-addressed store, hash-verified

120}
121
122func TestFileStoreGet(t *testing.T) {
123 f := &fakeStore{configs: map[string]types.AuthConfig{
124 "https://example.com": {
125 Username: "foo@example.com",
126 Auth: "super_secret_token",
127 ServerAddress: "https://example.com",
128 },
129 }}
130
131 s := NewFileStore(f)
132 a, err := s.Get("https://example.com")
133 if err != nil {
134 t.Fatal(err)
135 }
136 if a.Auth != "super_secret_token" {
137 t.Fatalf("expected auth `super_secret_token`, got %s", a.Auth)
138 }
139 if a.Username != "foo@example.com" {
140 t.Fatalf("expected username `foo@example.com`, got %s", a.Username)
141 }
142}
143
144func TestFileStoreGetAll(t *testing.T) {
145 s1 := "https://example.com"

Callers

nothing calls this directly

Calls 2

NewFileStoreFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…