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

Function HTTPRedirect

require/require.go:769–777  ·  view source on GitHub ↗

HTTPRedirect asserts that a specified handler returns a redirect status code. require.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} Returns whether the assertion was successful (true) or not (false).

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

Source from the content-addressed store, hash-verified

767//
768// Returns whether the assertion was successful (true) or not (false).
769func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
770 if h, ok := t.(tHelper); ok {
771 h.Helper()
772 }
773 if assert.HTTPRedirect(t, handler, method, url, values, msgAndArgs...) {
774 return
775 }
776 t.FailNow()
777}
778
779// HTTPRedirectf asserts that a specified handler returns a redirect status code.
780//

Callers 1

HTTPRedirectMethod · 0.70

Calls 3

HTTPRedirectFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected