(_ context.Context, options client.RegistryLoginOptions)
| 40 | } |
| 41 | |
| 42 | func (*fakeClient) RegistryLogin(_ context.Context, options client.RegistryLoginOptions) (client.RegistryLoginResult, error) { |
| 43 | if options.Password == expiredPassword { |
| 44 | return client.RegistryLoginResult{}, errors.New("invalid Username or Password") |
| 45 | } |
| 46 | if options.Password == useToken { |
| 47 | return client.RegistryLoginResult{ |
| 48 | Auth: registrytypes.AuthResponse{IdentityToken: options.Password}, |
| 49 | }, nil |
| 50 | } |
| 51 | if options.Username == unknownUser { |
| 52 | return client.RegistryLoginResult{}, errors.New(errUnknownUser) |
| 53 | } |
| 54 | return client.RegistryLoginResult{}, nil |
| 55 | } |
| 56 | |
| 57 | func TestLoginWithCredStoreCreds(t *testing.T) { |
| 58 | testCases := []struct { |
no outgoing calls
no test coverage detected