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

Method HTTPErrorf

require/require_forward.go:607–612  ·  view source on GitHub ↗

HTTPErrorf asserts that a specified handler returns an error status code. a.HTTPErrorf(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, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

605//
606// Returns whether the assertion was successful (true) or not (false).
607func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
608 if h, ok := a.t.(tHelper); ok {
609 h.Helper()
610 }
611 HTTPErrorf(a.t, handler, method, url, values, msg, args...)
612}
613
614// HTTPRedirect asserts that a specified handler returns a redirect status code.
615//

Callers

nothing calls this directly

Calls 2

HTTPErrorfFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected