MCPcopy Index your code
hub / github.com/coder/coder / TestBaggage

Function TestBaggage

coderd/audit/request_test.go:15–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestBaggage(t *testing.T) {
16 t.Parallel()
17 prop := propagation.NewCompositeTextMapPropagator(
18 propagation.TraceContext{},
19 propagation.Baggage{},
20 )
21
22 expected := audit.WorkspaceBuildBaggage{
23 IP: "127.0.0.1",
24 }
25
26 ctx, err := audit.BaggageToContext(context.Background(), expected)
27 require.NoError(t, err)
28
29 carrier := propagation.MapCarrier{}
30 prop.Inject(ctx, carrier)
31 bCtx := prop.Extract(ctx, carrier)
32 got := audit.BaggageFromContext(bCtx)
33
34 require.Equal(t, expected, got)
35}
36
37func TestResourceTarget_ChatTitleNotLeaked(t *testing.T) {
38 t.Parallel()

Callers

nothing calls this directly

Calls 3

BaggageToContextFunction · 0.92
BaggageFromContextFunction · 0.92
EqualMethod · 0.45

Tested by

no test coverage detected