MCPcopy Create free account
hub / github.com/prometheus/common / TestInvalidHTTPConfigs

Function TestInvalidHTTPConfigs

config/http_config_test.go:1402–1413  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1400}
1401
1402func TestInvalidHTTPConfigs(t *testing.T) {
1403 for _, ee := range invalidHTTPClientConfigs {
1404 _, _, err := LoadHTTPConfigFile(ee.httpClientConfigFile)
1405 if err == nil {
1406 t.Error("Expected error with config but got none")
1407 continue
1408 }
1409 if !strings.Contains(err.Error(), ee.errMsg) {
1410 t.Errorf("Expected error for invalid HTTP client configuration to contain %q but got: %s", ee.errMsg, err)
1411 }
1412 }
1413}
1414
1415type roundTrip struct {
1416 theResponse *http.Response

Callers

nothing calls this directly

Calls 2

LoadHTTPConfigFileFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected