(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func 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 | |
| 194 | func TestNativeStoreGetMissingCredentials(t *testing.T) { |
| 195 | f := &fakeStore{configs: map[string]types.AuthConfig{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…