Skip to content

Commit

Permalink
Check err for nil in tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Fontein <[email protected]>
  • Loading branch information
felixfontein authored and hiddeco committed Oct 3, 2023
1 parent f668c71 commit dd59dc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions kms/keysource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ func TestMasterKey_createKMSConfig(t *testing.T) {
assert.NoError(t, err)

creds, err := cfg.Credentials.Retrieve(context.TODO())
assert.Nil(t, err)
assert.Equal(t, "id", creds.AccessKeyID)
assert.Equal(t, "secret", creds.SecretAccessKey)
assert.Equal(t, "token", creds.SessionToken)
Expand Down
3 changes: 3 additions & 0 deletions pgp/keysource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ func TestMasterKey_Decrypt(t *testing.T) {
fingerprint,
"--no-encrypt-to",
}, bytes.NewReader(data))
assert.Nil(t, err)
assert.NoErrorf(t, gnuPGHome.ImportFile(mockPrivateKey), stderr.String())

encryptedData := stdout.String()
Expand Down Expand Up @@ -414,6 +415,7 @@ func TestMasterKey_decryptWithOpenPGP(t *testing.T) {
fingerprint,
"--no-encrypt-to",
}, bytes.NewReader(data))
assert.Nil(t, err)
assert.NoErrorf(t, gnuPGHome.ImportFile(mockPrivateKey), stderr.String())

encryptedData := stdout.String()
Expand Down Expand Up @@ -462,6 +464,7 @@ func TestMasterKey_decryptWithGnuPG(t *testing.T) {
fingerprint,
"--no-encrypt-to",
}, bytes.NewReader(data))
assert.Nil(t, err)
assert.NoErrorf(t, gnuPGHome.ImportFile(mockPrivateKey), stderr.String())

encryptedData := stdout.String()
Expand Down

0 comments on commit dd59dc1

Please sign in to comment.