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

Function TestHttpBodyWrappers

assert/http_assertions_test.go:219–232  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

217}
218
219func TestHttpBodyWrappers(t *testing.T) {
220 t.Parallel()
221
222 assert := New(t)
223 mockAssert := New(new(testing.T))
224
225 assert.True(mockAssert.HTTPBodyContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!"))
226 assert.True(mockAssert.HTTPBodyContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World"))
227 assert.False(mockAssert.HTTPBodyContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world"))
228
229 assert.False(mockAssert.HTTPBodyNotContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!"))
230 assert.False(mockAssert.HTTPBodyNotContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World"))
231 assert.True(mockAssert.HTTPBodyNotContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world"))
232}

Callers

nothing calls this directly

Calls 5

NewFunction · 0.70
TrueMethod · 0.45
HTTPBodyContainsMethod · 0.45
FalseMethod · 0.45
HTTPBodyNotContainsMethod · 0.45

Tested by

no test coverage detected