MCPcopy Create free account
hub / github.com/belak/gitdir / TestCtxPublicKey

Function TestCtxPublicKey

context_test.go:154–166  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

152}
153
154func TestCtxPublicKey(t *testing.T) {
155 t.Parallel()
156
157 ctx := context.Background()
158
159 // Check the default value
160 assert.Nil(t, CtxPublicKey(ctx))
161
162 // Check that when we set a value, this properly extracts it.
163 pk := &models.PublicKey{}
164 ctx = context.WithValue(ctx, contextKeyPublicKey, pk)
165 assert.Equal(t, pk, CtxPublicKey(ctx))
166}

Callers

nothing calls this directly

Calls 1

CtxPublicKeyFunction · 0.85

Tested by

no test coverage detected