MCPcopy
hub / github.com/expr-lang/expr / HTTPError

Function HTTPError

internal/testify/require/require.go:726–734  ·  view source on GitHub ↗

HTTPError asserts that a specified handler returns an error status code. assert.HTTPError(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, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

724//
725// Returns whether the assertion was successful (true) or not (false).
726func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
727 if h, ok := t.(tHelper); ok {
728 h.Helper()
729 }
730 if assert.HTTPError(t, handler, method, url, values, msgAndArgs...) {
731 return
732 }
733 t.FailNow()
734}
735
736// HTTPErrorf asserts that a specified handler returns an error status code.
737//

Callers 1

HTTPErrorMethod · 0.70

Calls 3

HTTPErrorFunction · 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…