MCPcopy
hub / github.com/grafana/tempo / TestApplyHeadersGRPC

Function TestApplyHeadersGRPC

cmd/tempo-cli/shared_test.go:78–85  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestApplyHeadersGRPC(t *testing.T) {
79 ctx := applyHeadersGRPC(context.Background(), []string{"X-TOKEN=my-secret", "X-Custom=value"})
80
81 md, ok := metadata.FromOutgoingContext(ctx)
82 require.True(t, ok)
83 require.Equal(t, []string{"my-secret"}, md.Get("X-TOKEN"))
84 require.Equal(t, []string{"value"}, md.Get("X-Custom"))
85}
86
87func TestApplyHeadersGRPC_lastWins(t *testing.T) {
88 ctx := applyHeadersGRPC(context.Background(), []string{"X-TOKEN=first", "X-TOKEN=second"})

Callers

nothing calls this directly

Calls 3

applyHeadersGRPCFunction · 0.85
GetMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected