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

Function TestResponse_Constructors

response_test.go:88–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func TestResponse_Constructors(t *testing.T) {
89 t.Run("reporter", func(t *testing.T) {
90 reporter := newMockReporter(t)
91 resp := NewResponse(reporter, &http.Response{})
92 resp.chain.assert(t, success)
93 })
94
95 t.Run("config", func(t *testing.T) {
96 reporter := newMockReporter(t)
97 resp := NewResponseC(Config{
98 Reporter: reporter,
99 }, &http.Response{})
100 resp.chain.assert(t, success)
101 })
102
103 t.Run("chain", func(t *testing.T) {
104 chain := newMockChain(t)
105 reporter := newMockReporter(t)
106 config := newMockConfig(reporter)
107 value := newResponse(responseOpts{
108 config: config,
109 chain: chain,
110 httpResp: &http.Response{},
111 })
112 assert.NotSame(t, value.chain, chain)
113 assert.Equal(t, value.chain.context.Path, chain.context.Path)
114 })
115}
116
117func TestResponse_Raw(t *testing.T) {
118 reporter := newMockReporter(t)

Callers

nothing calls this directly

Calls 8

newMockReporterFunction · 0.85
NewResponseFunction · 0.85
NewResponseCFunction · 0.85
newMockChainFunction · 0.85
newMockConfigFunction · 0.85
newResponseFunction · 0.85
assertMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…