MCPcopy Index your code
hub / github.com/gavv/httpexpect / TestBinder_Chunked

Function TestBinder_Chunked

binder_test.go:152–176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

150}
151
152func TestBinder_Chunked(t *testing.T) {
153 handler := &mockHandler{
154 t: t,
155 chunked: true,
156 }
157
158 client := &http.Client{
159 Transport: NewBinder(handler),
160 }
161
162 req, err := http.NewRequest("GET", "http://example.com/path", strings.NewReader("body"))
163 if err != nil {
164 t.Fatal(err)
165 }
166
167 req.ContentLength = -1
168
169 resp, err := client.Do(req)
170 if err != nil {
171 t.Fatal(err)
172 }
173
174 assert.Equal(t, []string{"chunked"}, resp.Request.TransferEncoding)
175 assert.Equal(t, []string{"chunked"}, resp.TransferEncoding)
176}
177
178func TestFastBinder_Basic(t *testing.T) {
179 handler := func(ctx *fasthttp.RequestCtx) {

Callers

nothing calls this directly

Calls 4

DoMethod · 0.95
NewBinderFunction · 0.85
NewRequestMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…