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

Function TestDecryptUnencryptedComments

sops_test.go:992–1007  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

990}
991
992func TestDecryptUnencryptedComments(t *testing.T) {
993 tree := Tree{
994 Branches: TreeBranches{
995 TreeBranch{
996 TreeItem{
997 // We use `error` to simulate an error decrypting, the fake cipher will error in this case
998 Key: Comment{Value: "error"},
999 Value: nil,
1000 },
1001 },
1002 },
1003 Metadata: Metadata{},
1004 }
1005 tree.Decrypt(bytes.Repeat([]byte{'f'}, 32), reverseCipher{})
1006 assert.Equal(t, "error", tree.Branches[0][0].Key.(Comment).Value)
1007}
1008
1009func TestSetNewKey(t *testing.T) {
1010 branch := TreeBranch{

Callers

nothing calls this directly

Calls 1

DecryptMethod · 0.95

Tested by

no test coverage detected