Skip to content

Commit

Permalink
docker auth: add no auth test
Browse files Browse the repository at this point in the history
  • Loading branch information
skylenet committed Oct 30, 2024
1 parent 3c3100b commit 4e9bad9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ func writeStaticConfig(t *testing.T, configContent string) string {
return tmpDir
}

func TestGetNoAuth(t *testing.T) {
os.Setenv(ENV_DOCKER_CONFIG, "/does/not/exist")
authConfig, err := GetAuthFromDockerConfig("my-repo/my-image:latest")
assert.NoError(t, err)
assert.Nil(t, authConfig, "Auth config should be nil")
}

func TestGetAuthConfigForRepoPlain(t *testing.T) {
expectedUser := "user"
expectedPassword := "password"
Expand Down

0 comments on commit 4e9bad9

Please sign in to comment.