MCPcopy Create free account
hub / github.com/jmespath/go-jmespath / HTTPErrorf

Function HTTPErrorf

internal/testify/assert/assertion_format.go:229–234  ·  view source on GitHub ↗

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

(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

227//
228// Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false).
229func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
230 if h, ok := t.(tHelper); ok {
231 h.Helper()
232 }
233 return HTTPError(t, handler, method, url, values, append([]interface{}{msg}, args...)...)
234}
235
236// HTTPRedirectf asserts that a specified handler returns a redirect status code.
237//

Callers 2

HTTPErrorfFunction · 0.92
HTTPErrorfMethod · 0.70

Calls 2

HTTPErrorFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…