Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shyiko committed Apr 15, 2018
1 parent 16e3471 commit e459cb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cmd/encrypt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestEncryptGivenEmptyData(t *testing.T) {
}

func TestEncrypt(t *testing.T) {
actual, err := EncryptWithContext([]byte(`{"kind": "Secret", "data": {"key": "value"}}`), EncryptionContext{})
actual, err := EncryptWithContext([]byte(`{"kind": "Secret", "data": {"key": "dmFsdWU="}}`), EncryptionContext{})
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -74,7 +74,7 @@ func TestKeyRotation(t *testing.T) {
}

func TestEncryptKeyAdd(t *testing.T) {
input := "data:\n key: value\nkind: Secret\n"
input := "data:\n key: dmFsdWU=\nkind: Secret\n"
encrypted, err := EncryptWithContext([]byte(input), EncryptionContext{})
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -127,7 +127,7 @@ func TestEncryptKeyRemove(t *testing.T) {
primaryKey.Fingerprint,
"72ECF46A56B4AD39C907BBB71646B01B86E50310",
}
encrypted, err := EncryptWithContext([]byte("data:\n key: value\nkind: Secret\n"), EncryptionContext{
encrypted, err := EncryptWithContext([]byte("data:\n key: dmFsdWU=\nkind: Secret\n"), EncryptionContext{
Keys: Keys{
KeyWithDEK{Key{KTPGP, expected[0]}, nil},
KeyWithDEK{Key{KTPGP, expected[1]}, nil},
Expand Down
4 changes: 2 additions & 2 deletions cmd/introspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func TestIntrospectUnencrypted(t *testing.T) {
if _, err := Introspect([]byte("data:\n key: value\nkind: Secret\n")); err == nil {
if _, err := Introspect([]byte("data:\n key: dmFsdWU=\nkind: Secret\n")); err == nil {
t.Fail()
} else {
actual := err.Error()
Expand All @@ -22,7 +22,7 @@ func TestIntrospect(t *testing.T) {
"160A7A9CF46221A56B06AD64461A804F2609FD89",
"72ECF46A56B4AD39C907BBB71646B01B86E50310",
}
encrypted, err := EncryptWithContext([]byte("data:\n key: value\nkind: Secret\n"), EncryptionContext{
encrypted, err := EncryptWithContext([]byte("data:\n key: dmFsdWU=\nkind: Secret\n"), EncryptionContext{
Keys: Keys{
KeyWithDEK{Key{KTPGP, expected[0]}, nil},
KeyWithDEK{Key{KTPGP, expected[1]}, nil},
Expand Down
6 changes: 4 additions & 2 deletions cmd/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ data:
}

func TestMerge(t *testing.T) {
encrypted, err := EncryptWithContext([]byte(`{"kind":"Secret","data":{"KEY":"VALUE","ANOTHER_KEY":"ANOTHER_VALUE"}}`),
EncryptionContext{})
encrypted, err := EncryptWithContext(
[]byte(`{"kind":"Secret","data":{"KEY":"VkFMVUU=","ANOTHER_KEY":"QU5PVEhFUl9WQUxVRQ=="}}`),
EncryptionContext{},
)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit e459cb3

Please sign in to comment.