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

Function HTTPBodyContainsf

require/require.go:678–686  ·  view source on GitHub ↗

HTTPBodyContainsf asserts that a specified handler returns a body that contains a string. require.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") Returns whether the assertion was successful (true) or not (false).

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

Source from the content-addressed store, hash-verified

676//
677// Returns whether the assertion was successful (true) or not (false).
678func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) {
679 if h, ok := t.(tHelper); ok {
680 h.Helper()
681 }
682 if assert.HTTPBodyContainsf(t, handler, method, url, values, str, msg, args...) {
683 return
684 }
685 t.FailNow()
686}
687
688// HTTPBodyNotContains asserts that a specified handler returns a
689// body that does not contain a string.

Callers 1

HTTPBodyContainsfMethod · 0.70

Calls 3

HTTPBodyContainsfFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected