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

Method testConfig

tools/clientcmd/validation_test.go:513–534  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

511}
512
513func (c configValidationTest) testConfig(t *testing.T) {
514 err := Validate(*c.config)
515
516 if len(c.expectedErrorSubstring) != 0 {
517 if err == nil {
518 t.Errorf("Expected error containing: %v", c.expectedErrorSubstring)
519 } else {
520 for _, curr := range c.expectedErrorSubstring {
521 if err != nil && !strings.Contains(err.Error(), curr) {
522 t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, err)
523 }
524 }
525 if !IsConfigurationInvalid(err) {
526 t.Errorf("all errors should be configuration invalid: %v", err)
527 }
528 }
529 } else {
530 if err != nil {
531 t.Errorf("Unexpected error: %v", err)
532 }
533 }
534}
535
536func (c configValidationTest) testCluster(clusterName string, t *testing.T) {
537 errs := validateClusterInfo(clusterName, *c.config.Clusters[clusterName])

Calls 4

ValidateFunction · 0.85
IsConfigurationInvalidFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected