MCPcopy
hub / github.com/expr-lang/expr / TestHTTPRequestWithParams

Function TestHTTPRequestWithParams

internal/testify/assert/http_assertions_test.go:168–182  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

166}
167
168func TestHTTPRequestWithParams(t *testing.T) {
169 var got *http.Request
170 handler := func(w http.ResponseWriter, r *http.Request) {
171 got = r
172 w.WriteHeader(http.StatusOK)
173 }
174 params := url.Values{}
175 params.Add("id", "12345")
176
177 True(t, HTTPSuccess(t, handler, "GET", "/url", params))
178
179 Equal(t, url.Values{"id": []string{"12345"}}, got.URL.Query())
180 Equal(t, "/url?id=12345", got.URL.String())
181 Equal(t, "/url?id=12345", got.URL.RequestURI())
182}
183
184func TestHttpBody(t *testing.T) {
185 assert := New(t)

Callers

nothing calls this directly

Calls 5

TrueFunction · 0.70
HTTPSuccessFunction · 0.70
EqualFunction · 0.70
AddMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…