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

Method testCluster

tools/clientcmd/validation_test.go:536–554  ·  view source on GitHub ↗
(clusterName string, t *testing.T)

Source from the content-addressed store, hash-verified

534}
535
536func (c configValidationTest) testCluster(clusterName string, t *testing.T) {
537 errs := validateClusterInfo(clusterName, *c.config.Clusters[clusterName])
538
539 if len(c.expectedErrorSubstring) != 0 {
540 if len(errs) == 0 {
541 t.Errorf("Expected error containing: %v", c.expectedErrorSubstring)
542 }
543 for _, curr := range c.expectedErrorSubstring {
544 if len(errs) != 0 && !strings.Contains(utilerrors.NewAggregate(errs).Error(), curr) {
545 t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, utilerrors.NewAggregate(errs))
546 }
547 }
548
549 } else {
550 if len(errs) != 0 {
551 t.Errorf("Unexpected error: %v", utilerrors.NewAggregate(errs))
552 }
553 }
554}
555
556func (c configValidationTest) testAuthInfo(authInfoName string, t *testing.T) {
557 errs := validateAuthInfo(authInfoName, *c.config.AuthInfos[authInfoName])

Calls 3

validateClusterInfoFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected