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

Method HTTPStatusCodef

assert/assertion_forward.go:654–659  ·  assert/assertion_forward.go::Assertions.HTTPStatusCodef

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

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

Source from the content-addressed store, hash-verified

652//
653// Returns whether the assertion was successful (true) or not (false).
654func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool {
655 if h, ok := a.t.(tHelper); ok {
656 h.Helper()
657 }
658 return HTTPStatusCodef(a.t, handler, method, url, values, statuscode, msg, args...)
659}
660
661// HTTPSuccess asserts that a specified handler returns a success status code.
662//

Callers

nothing calls this directly

Calls 2

HTTPStatusCodefFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected