MCPcopy Index your code
hub / github.com/getsops/sops / TestMasterKey_ToMap

Function TestMasterKey_ToMap

hckms/keysource_test.go:164–174  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

162}
163
164func TestMasterKey_ToMap(t *testing.T) {
165 key, err := NewMasterKey(testKeyID1)
166 assert.NoError(t, err)
167 key.EncryptedKey = "test-encrypted-key"
168 key.CreationDate = time.Date(2025, 1, 1, 12, 0, 0, 0, time.UTC)
169
170 m := key.ToMap()
171 assert.Equal(t, testKeyID1, m["key_id"])
172 assert.Equal(t, "test-encrypted-key", m["enc"])
173 assert.Equal(t, "2025-01-01T12:00:00Z", m["created_at"])
174}
175
176func TestMasterKey_TypeToIdentifier(t *testing.T) {
177 key, err := NewMasterKey(testKeyID1)

Callers

nothing calls this directly

Calls 2

ToMapMethod · 0.95
NewMasterKeyFunction · 0.70

Tested by

no test coverage detected