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

Function HTTPStatusCode

internal/testify/require/require.go:786–794  ·  view source on GitHub ↗

HTTPStatusCode asserts that a specified handler returns a specified status code. assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) Returns whether the assertion was successful (true) or not (false).

(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

784//
785// Returns whether the assertion was successful (true) or not (false).
786func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) {
787 if h, ok := t.(tHelper); ok {
788 h.Helper()
789 }
790 if assert.HTTPStatusCode(t, handler, method, url, values, statuscode, msgAndArgs...) {
791 return
792 }
793 t.FailNow()
794}
795
796// HTTPStatusCodef asserts that a specified handler returns a specified status code.
797//

Callers 1

HTTPStatusCodeMethod · 0.70

Calls 3

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