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

Function HTTPRedirectf

require/require.go:784–792  ·  view source on GitHub ↗

HTTPRedirectf asserts that a specified handler returns a redirect status code. require.HTTPRedirectf(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, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

782//
783// Returns whether the assertion was successful (true) or not (false).
784func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
785 if h, ok := t.(tHelper); ok {
786 h.Helper()
787 }
788 if assert.HTTPRedirectf(t, handler, method, url, values, msg, args...) {
789 return
790 }
791 t.FailNow()
792}
793
794// HTTPStatusCode asserts that a specified handler returns a specified status code.
795//

Callers 1

HTTPRedirectfMethod · 0.70

Calls 3

HTTPRedirectfFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected