(t *testing.T)
| 152 | } |
| 153 | |
| 154 | func 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 | } |
nothing calls this directly
no test coverage detected