MCPcopy Create free account
hub / github.com/gavv/httpexpect / TestPrinter_Panics

Function TestPrinter_Panics

printer_test.go:151–192  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func TestPrinter_Panics(t *testing.T) {
152 t.Run("CompactPrinter", func(t *testing.T) {
153 printer := NewCompactPrinter(t)
154
155 assert.NotPanics(t, func() {
156 printer.Request(&http.Request{})
157 })
158 assert.NotPanics(t, func() {
159 printer.Response(&http.Response{
160 Body: failingReader{},
161 }, 0)
162 })
163 })
164
165 t.Run("CurlPrinter", func(t *testing.T) {
166 printer := NewCurlPrinter(t)
167
168 assert.Panics(t, func() {
169 printer.Request(&http.Request{})
170 })
171 assert.NotPanics(t, func() {
172 printer.Response(&http.Response{
173 Body: failingReader{},
174 }, 0)
175 })
176 })
177
178 t.Run("DebugPrinter", func(t *testing.T) {
179 printer := NewDebugPrinter(t, true)
180
181 assert.Panics(t, func() {
182 printer.Request(&http.Request{
183 Body: failingReader{},
184 })
185 })
186 assert.Panics(t, func() {
187 printer.Response(&http.Response{
188 Body: failingReader{},
189 }, 0)
190 })
191 })
192}

Callers

nothing calls this directly

Calls 5

RequestMethod · 0.95
ResponseMethod · 0.95
NewCompactPrinterFunction · 0.85
NewCurlPrinterFunction · 0.85
NewDebugPrinterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…