Skip to content

Commit f35fb0f

Browse files
committed
cli/command: TestGetDefaultAuthConfig: cleanup test file
Prevent a `cli/command/filename` file being left behind after running tests. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent b22f1ae commit f35fb0f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cli/command/registry_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package command_test
33
import (
44
"bytes"
55
"path"
6+
"path/filepath"
67
"testing"
78

89
"github.com/docker/cli/cli/command"
@@ -58,7 +59,9 @@ func TestGetDefaultAuthConfig(t *testing.T) {
5859
expectedAuthConfig: testAuthConfigs[1],
5960
},
6061
}
61-
cfg := configfile.New("filename")
62+
63+
tmpDir := t.TempDir()
64+
cfg := configfile.New(filepath.Join(tmpDir, "cli-config.json"))
6265
for _, authConfig := range testAuthConfigs {
6366
assert.Check(t, cfg.GetCredentialsStore(authConfig.ServerAddress).Store(configtypes.AuthConfig{
6467
Username: authConfig.Username,

0 commit comments

Comments
 (0)