(contextName string, t *testing.T)
| 471 | } |
| 472 | |
| 473 | func (c configValidationTest) testContext(contextName string, t *testing.T) { |
| 474 | errs := validateContext(contextName, *c.config.Contexts[contextName], *c.config) |
| 475 | |
| 476 | if len(c.expectedErrorSubstring) != 0 { |
| 477 | if len(errs) == 0 { |
| 478 | t.Errorf("Expected error containing: %v", c.expectedErrorSubstring) |
| 479 | } |
| 480 | for _, curr := range c.expectedErrorSubstring { |
| 481 | if len(errs) != 0 && !strings.Contains(utilerrors.NewAggregate(errs).Error(), curr) { |
| 482 | t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, utilerrors.NewAggregate(errs)) |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | } else { |
| 487 | if len(errs) != 0 { |
| 488 | t.Errorf("Unexpected error: %v", utilerrors.NewAggregate(errs)) |
| 489 | } |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | func (c configValidationTest) testConfirmUsable(contextName string, t *testing.T) { |
| 494 | err := ConfirmUsable(*c.config, contextName) |
no test coverage detected