AssertLoadError will load a config and expect an error
(t *testing.T, rawConfig string, configType string, expectedError string)
| 362 | |
| 363 | // AssertLoadError will load a config and expect an error |
| 364 | func AssertLoadError(t *testing.T, rawConfig string, configType string, expectedError string) { |
| 365 | t.Helper() |
| 366 | |
| 367 | tc := NewTester(t) |
| 368 | |
| 369 | err := tc.initServer(rawConfig, configType) |
| 370 | if !strings.Contains(err.Error(), expectedError) { |
| 371 | t.Errorf("expected error \"%s\" but got \"%s\"", expectedError, err.Error()) |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | // AssertRedirect makes a request and asserts the redirection happens |
| 376 | func (tc *Tester) AssertRedirect(requestURI string, expectedToLocation string, expectedStatusCode int) *http.Response { |