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

Function TestPrinter_Curl

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

Source from the content-addressed store, hash-verified

67}
68
69func TestPrinter_Curl(t *testing.T) {
70 cases := []struct {
71 name string
72 request *http.Request
73 response *http.Response
74 }{
75 {
76 name: "nil request and response",
77 request: nil,
78 response: nil,
79 },
80 {
81 name: "has body",
82 request: httpRequest(strings.NewReader("test")),
83 response: httpResponse(strings.NewReader("test")),
84 },
85 {
86 name: "no body",
87 request: httpRequest(nil),
88 response: httpResponse(nil),
89 },
90 }
91
92 for _, tc := range cases {
93 t.Run(tc.name, func(t *testing.T) {
94 printer := NewCurlPrinter(t)
95
96 printer.Request(tc.request)
97 printer.Response(tc.response, 0)
98 })
99 }
100}
101
102func TestPrinter_Debug(t *testing.T) {
103 cases := []struct {

Callers

nothing calls this directly

Calls 5

RequestMethod · 0.95
ResponseMethod · 0.95
httpRequestFunction · 0.85
httpResponseFunction · 0.85
NewCurlPrinterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…