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

Function TestDecryptComments

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

Source from the content-addressed store, hash-verified

959}
960
961func TestDecryptComments(t *testing.T) {
962 tree := Tree{
963 Branches: TreeBranches{
964 TreeBranch{
965 TreeItem{
966 Key: Comment{Value: "oof"},
967 Value: nil,
968 },
969 TreeItem{
970 Key: "list",
971 Value: []interface{}{
972 "1",
973 Comment{Value: "rab"},
974 "2",
975 },
976 },
977 TreeItem{
978 Key: "list",
979 Value: nil,
980 },
981 },
982 },
983 Metadata: Metadata{
984 UnencryptedSuffix: DefaultUnencryptedSuffix,
985 },
986 }
987 tree.Decrypt(bytes.Repeat([]byte{'f'}, 32), reverseCipher{})
988 assert.Equal(t, "foo", tree.Branches[0][0].Key.(Comment).Value)
989 assert.Equal(t, "bar", tree.Branches[0][1].Value.([]interface{})[1])
990}
991
992func TestDecryptUnencryptedComments(t *testing.T) {
993 tree := Tree{

Callers

nothing calls this directly

Calls 1

DecryptMethod · 0.95

Tested by

no test coverage detected