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

Method HTTPError

internal/testify/assert/assertion_forward.go:580–585  ·  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

578//
579// Returns whether the assertion was successful (true) or not (false).
580func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool {
581 if h, ok := a.t.(tHelper); ok {
582 h.Helper()
583 }
584 return HTTPError(a.t, handler, method, url, values, msgAndArgs...)
585}
586
587// HTTPErrorf asserts that a specified handler returns an error status code.
588//

Callers 1

TestHTTPStatusesWrapperFunction · 0.45

Calls 2

HTTPErrorFunction · 0.70
HelperMethod · 0.45

Tested by 1

TestHTTPStatusesWrapperFunction · 0.36