MCPcopy Index your code
hub / github.com/expr-lang/expr / HTTPErrorf

Function HTTPErrorf

internal/testify/require/require.go:741–749  ·  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) 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

739//
740// Returns whether the assertion was successful (true) or not (false).
741func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
742 if h, ok := t.(tHelper); ok {
743 h.Helper()
744 }
745 if assert.HTTPErrorf(t, handler, method, url, values, msg, args...) {
746 return
747 }
748 t.FailNow()
749}
750
751// HTTPRedirect asserts that a specified handler returns a redirect status code.
752//

Callers 1

HTTPErrorfMethod · 0.70

Calls 3

HTTPErrorfFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…