MCPcopy Create free account
hub / github.com/Clivern/Poodle / TestHttpGetStatusCode3

Function TestHttpGetStatusCode3

core/module/http_test.go:169–187  ·  view source on GitHub ↗

TestHttpGetStatusCode3 test cases

(t *testing.T)

Source from the content-addressed store, hash-verified

167
168// TestHttpGetStatusCode3 test cases
169func TestHttpGetStatusCode3(t *testing.T) {
170 t.Run("TestHttpGetStatusCode3", func(t *testing.T) {
171 httpClient := NewHTTPClient()
172 response, error := httpClient.Get(
173 context.TODO(),
174 "https://httpbin.org/status/404",
175 map[string]string{"arg1": "value1"},
176 map[string]string{"X-Api-Key": "poodle-123"},
177 )
178
179 pkg.Expect(t, http.StatusNotFound, httpClient.GetStatusCode(response))
180 pkg.Expect(t, nil, error)
181
182 body, error := httpClient.ToString(response)
183
184 pkg.Expect(t, "", body)
185 pkg.Expect(t, nil, error)
186 })
187}
188
189// TestHttpGetStatusCode4 test cases
190func TestHttpGetStatusCode4(t *testing.T) {

Callers

nothing calls this directly

Calls 5

GetMethod · 0.95
GetStatusCodeMethod · 0.95
ToStringMethod · 0.95
ExpectFunction · 0.92
NewHTTPClientFunction · 0.85

Tested by

no test coverage detected