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

Function TestPrinter_Compact

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

Source from the content-addressed store, hash-verified

34}
35
36func TestPrinter_Compact(t *testing.T) {
37 cases := []struct {
38 name string
39 request *http.Request
40 response *http.Response
41 }{
42 {
43 name: "nil request and response",
44 request: nil,
45 response: nil,
46 },
47 {
48 name: "has body",
49 request: httpRequest(strings.NewReader("test")),
50 response: httpResponse(strings.NewReader("test")),
51 },
52 {
53 name: "no body",
54 request: httpRequest(nil),
55 response: httpResponse(nil),
56 },
57 }
58
59 for _, tc := range cases {
60 t.Run(tc.name, func(t *testing.T) {
61 printer := NewCompactPrinter(t)
62
63 printer.Request(tc.request)
64 printer.Response(tc.response, 0)
65 })
66 }
67}
68
69func TestPrinter_Curl(t *testing.T) {
70 cases := []struct {

Callers

nothing calls this directly

Calls 5

RequestMethod · 0.95
ResponseMethod · 0.95
httpRequestFunction · 0.85
httpResponseFunction · 0.85
NewCompactPrinterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…