MCPcopy
hub / github.com/getsops/sops / TestEncryptWrongType

Function TestEncryptWrongType

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

Source from the content-addressed store, hash-verified

847type WrongType struct{}
848
849func TestEncryptWrongType(t *testing.T) {
850 branches := TreeBranches{
851 TreeBranch{
852 TreeItem{
853 Key: "foo",
854 Value: WrongType{},
855 },
856 },
857 }
858 tree := Tree{Branches: branches, Metadata: Metadata{UnencryptedSuffix: DefaultUnencryptedSuffix}}
859 result, err := tree.Encrypt(bytes.Repeat([]byte{'f'}, 32), MockCipher{})
860 assert.Equal(t, "", result)
861 assert.ErrorContains(t, err, "unknown type: sops.WrongType")
862}
863
864func TestTruncateTree(t *testing.T) {
865 tree := TreeBranch{

Callers

nothing calls this directly

Calls 1

EncryptMethod · 0.95

Tested by

no test coverage detected