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

Function HTTPStatusCodef

internal/testify/require/require.go:801–809  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

799//
800// Returns whether the assertion was successful (true) or not (false).
801func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) {
802 if h, ok := t.(tHelper); ok {
803 h.Helper()
804 }
805 if assert.HTTPStatusCodef(t, handler, method, url, values, statuscode, msg, args...) {
806 return
807 }
808 t.FailNow()
809}
810
811// HTTPSuccess asserts that a specified handler returns a success status code.
812//

Callers 1

HTTPStatusCodefMethod · 0.70

Calls 3

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