summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/auth/auth_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/auth/auth_test.go b/pkg/auth/auth_test.go
index a0b97b106..38f82ee04 100644
--- a/pkg/auth/auth_test.go
+++ b/pkg/auth/auth_test.go
@@ -4,6 +4,7 @@ import (
"encoding/base64"
"io/ioutil"
"net/http"
+ "os"
"testing"
"github.com/containers/image/v5/types"
@@ -57,13 +58,14 @@ func TestAuthConfigsToAuthFile(t *testing.T) {
filePath, err := authConfigsToAuthFile(configs)
if tc.shouldErr {
- assert.NotNil(t, err)
+ assert.Error(t, err)
assert.Empty(t, filePath)
} else {
- assert.Nil(t, err)
+ assert.NoError(t, err)
content, err := ioutil.ReadFile(filePath)
- assert.Nil(t, err)
+ require.NoError(t, err)
assert.Contains(t, string(content), tc.expectedContains)
+ os.Remove(filePath)
}
}
}