MCPcopy Create free account
hub / github.com/stretchr/testify / HTTPStatusCode

Method HTTPStatusCode

require/require_forward.go:629–634  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

627//
628// Returns whether the assertion was successful (true) or not (false).
629func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) {
630 if h, ok := a.t.(tHelper); ok {
631 h.Helper()
632 }
633 HTTPStatusCode(a.t, handler, method, url, values, statuscode, msgAndArgs...)
634}
635
636// HTTPStatusCodef asserts that a specified handler returns a specified status code.
637//

Callers

nothing calls this directly

Calls 2

HTTPStatusCodeFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected