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

Method RegistryLogin

cli/command/registry/login_test.go:42–55  ·  view source on GitHub ↗
(_ context.Context, options client.RegistryLoginOptions)

Source from the content-addressed store, hash-verified

40}
41
42func (*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
57func TestLoginWithCredStoreCreds(t *testing.T) {
58 testCases := []struct {

Callers 2

loginWithRegistryFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected