MCPcopy Create free account
hub / github.com/gotenberg/gotenberg / TestClientRequest

Function TestClientRequest

pkg/gotenberg/semconv/httpconvtest_test.go:306–322  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

304}
305
306func TestClientRequest(t *testing.T) {
307 body := strings.NewReader("Hello, world!")
308 url := "https://example.com:8888/foo/bar?stuff=morestuff"
309 req := httptest.NewRequest("pOST", url, body)
310 req.Header.Set("User-Agent", "go-test-agent")
311
312 want := []attribute.KeyValue{
313 attribute.String("http.request.method", "POST"),
314 attribute.String("http.request.method_original", "pOST"),
315 attribute.String("url.full", url),
316 attribute.String("server.address", "example.com"),
317 attribute.Int("server.port", 8888),
318 attribute.String("network.protocol.version", "1.1"),
319 }
320 got := semconv.HTTPClient{}.RequestTraceAttrs(req)
321 assert.ElementsMatch(t, want, got)
322}
323
324func TestClientResponse(t *testing.T) {
325 testcases := []struct {

Callers

nothing calls this directly

Calls 4

SetMethod · 0.80
StringMethod · 0.80
IntMethod · 0.80
RequestTraceAttrsMethod · 0.45

Tested by

no test coverage detected