MCPcopy
hub / github.com/kubernetes/client-go / testAuthInfo

Method testAuthInfo

tools/clientcmd/validation_test.go:556–574  ·  view source on GitHub ↗
(authInfoName string, t *testing.T)

Source from the content-addressed store, hash-verified

554}
555
556func (c configValidationTest) testAuthInfo(authInfoName string, t *testing.T) {
557 errs := validateAuthInfo(authInfoName, *c.config.AuthInfos[authInfoName])
558
559 if len(c.expectedErrorSubstring) != 0 {
560 if len(errs) == 0 {
561 t.Errorf("Expected error containing: %v", c.expectedErrorSubstring)
562 }
563 for _, curr := range c.expectedErrorSubstring {
564 if len(errs) != 0 && !strings.Contains(utilerrors.NewAggregate(errs).Error(), curr) {
565 t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, utilerrors.NewAggregate(errs))
566 }
567 }
568
569 } else {
570 if len(errs) != 0 {
571 t.Errorf("Unexpected error: %v", utilerrors.NewAggregate(errs))
572 }
573 }
574}

Calls 3

validateAuthInfoFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected