MCPcopy
hub / github.com/stretchr/testify / HTTPError

Method HTTPError

require/require_forward.go:595–600  ·  view source on GitHub ↗

HTTPError asserts that a specified handler returns an error status code. a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} Returns whether the assertion was successful (true) or not (false).

(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

593//
594// Returns whether the assertion was successful (true) or not (false).
595func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
596 if h, ok := a.t.(tHelper); ok {
597 h.Helper()
598 }
599 HTTPError(a.t, handler, method, url, values, msgAndArgs...)
600}
601
602// HTTPErrorf asserts that a specified handler returns an error status code.
603//

Callers

nothing calls this directly

Calls 2

HTTPErrorFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected