MCPcopy
hub / github.com/stretchr/testify / HTTPStatusCodef

Function HTTPStatusCodef

assert/assertion_format.go:329–334  ·  assert/assertion_format.go::HTTPStatusCodef

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

327//
328// Returns whether the assertion was successful (true) or not (false).
329func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool {
330 if h, ok := t.(tHelper); ok {
331 h.Helper()
332 }
333 return HTTPStatusCode(t, handler, method, url, values, statuscode, append([]interface{}{msg}, args...)...)
334}
335
336// HTTPSuccessf asserts that a specified handler returns a success status code.
337//

Callers 2

HTTPStatusCodefFunction · 0.92
HTTPStatusCodefMethod · 0.70

Calls 2

HTTPStatusCodeFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected