MCPcopy
hub / github.com/grafana/dskit / TestToHeader

Function TestToHeader

httpgrpc/httpgrpc_test.go:34–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestToHeader(t *testing.T) {
35 grpcHeaders := []*Header{
36 {Key: "X-Header", Values: []string{"a", "b", "c"}},
37 {Key: "traceparent", Values: []string{"01234"}},
38 }
39 httpHeaders := http.Header{}
40 ToHeader(grpcHeaders, httpHeaders)
41
42 require.Equal(t, http.Header{
43 "X-Header": []string{"a", "b", "c"},
44 "Traceparent": []string{"01234"},
45 }, httpHeaders)
46 require.Equal(t, "01234", httpHeaders.Get("traceparent"))
47}
48
49func TestErrorf(t *testing.T) {
50 code := 400

Callers

nothing calls this directly

Calls 3

ToHeaderFunction · 0.85
GetMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected