1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

Add test for dotenv EmitValue

This commit is contained in:
Adrian Utrilla
2018-10-31 18:19:55 -04:00
parent f84673fd22
commit 2a99f0411e

View File

@@ -29,26 +29,24 @@ var BRANCH = sops.TreeBranch{
},
}
func TestLoadEncryptedFile(t *testing.T) {
// FIXME: Implementation?
}
func TestLoadPlainFile(t *testing.T) {
branch, err := (&Store{}).LoadPlainFile(PLAIN)
assert.Nil(t, err)
assert.Equal(t, BRANCH, branch)
}
func TestEmitEncryptedFile(t *testing.T) {
// FIXME: Implementation?
}
func TestEmitPlainFile(t *testing.T) {
bytes, err := (&Store{}).EmitPlainFile(BRANCH)
assert.Nil(t, err)
assert.Equal(t, PLAIN, bytes)
}
func TestEmitValue(t *testing.T) {
// FIXME: Implementation?
func TestEmitValueString(t *testing.T) {
bytes, err := (&Store{}).EmitValue("hello")
assert.Nil(t, err)
assert.Equal(t, []byte("hello"), bytes)
}
func TestEmitValueNonstring(t *testing.T) {
_, err := (&Store{}).EmitValue(BRANCH)
assert.NotNil(t, err)
}