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

Method HTTPError

assert/assertion_forward.go:594–599  ·  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

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

Callers 1

TestHTTPStatusesWrapperFunction · 0.45

Calls 2

HTTPErrorFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestHTTPStatusesWrapperFunction · 0.36