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

Method HTTPBodyContains

assert/assertion_forward.go:543–548  ·  assert/assertion_forward.go::Assertions.HTTPBodyContains

HTTPBodyContains asserts that a specified handler returns a body that contains a string. a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") Returns whether the assertion was successful (true) or not (false).

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

Source from the content-addressed store, hash-verified

541//
542// Returns whether the assertion was successful (true) or not (false).
543func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool {
544 if h, ok := a.t.(tHelper); ok {
545 h.Helper()
546 }
547 return HTTPBodyContains(a.t, handler, method, url, values, str, msgAndArgs...)
548}
549
550// HTTPBodyContainsf asserts that a specified handler returns a
551// body that contains a string.

Callers 1

TestHttpBodyWrappersFunction · 0.45

Calls 2

HTTPBodyContainsFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestHttpBodyWrappersFunction · 0.36