MCPcopy Create free account
hub / github.com/BryanMwangi/pine / TestRequest_SetHeaders

Function TestRequest_SetHeaders

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

Source from the content-addressed store, hash-verified

57}
58
59func TestRequest_SetHeaders(t *testing.T) {
60 client := NewClient()
61 req := client.Request()
62
63 headers := map[string]string{"X-Custom-Header": "value"}
64 req.SetHeaders(headers)
65
66 if req.Header.Get("X-Custom-Header") != "value" {
67 t.Fatalf("expected header X-Custom-Header to be 'value', got %s", req.Header.Get("X-Custom-Header"))
68 }
69}
70
71func TestRequest_SetRequestURI(t *testing.T) {
72 client := NewClient()

Callers

nothing calls this directly

Calls 4

RequestMethod · 0.95
NewClientFunction · 0.85
SetHeadersMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected