From 20220567b6a953e25592412ad7d8b6b099efe8e3 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 29 Sep 2023 13:17:30 +0200 Subject: [PATCH] Check err for nil in tests. Signed-off-by: Felix Fontein --- kms/keysource_test.go | 1 + pgp/keysource_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/kms/keysource_test.go b/kms/keysource_test.go index 81cd9bbd83..4bed286215 100644 --- a/kms/keysource_test.go +++ b/kms/keysource_test.go @@ -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) diff --git a/pgp/keysource_test.go b/pgp/keysource_test.go index 187a75b1dd..049c148c12 100644 --- a/pgp/keysource_test.go +++ b/pgp/keysource_test.go @@ -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() @@ -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() @@ -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()