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

Function HTTPSuccess

require/require.go:829–837  ·  view source on GitHub ↗

HTTPSuccess asserts that a specified handler returns a success status code. require.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) 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

827//
828// Returns whether the assertion was successful (true) or not (false).
829func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
830 if h, ok := t.(tHelper); ok {
831 h.Helper()
832 }
833 if assert.HTTPSuccess(t, handler, method, url, values, msgAndArgs...) {
834 return
835 }
836 t.FailNow()
837}
838
839// HTTPSuccessf asserts that a specified handler returns a success status code.
840//

Callers 1

HTTPSuccessMethod · 0.70

Calls 3

HTTPSuccessFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected