Skip to content

Commit

Permalink
fix: fix the bugs in the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramk64 committed Oct 3, 2024
1 parent 2c3e52a commit aa6be1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/common/oras/authprovider/azure/azureidentity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ func TestMIProvide_RefreshAAD(t *testing.T) {

func TestMIProvide_Failure_InvalidHostName(t *testing.T) {
provider := &MIAuthProvider{
tenantID: "test_tenant",
clientID: "test_client",
identityToken: azcore.AccessToken{
Token: "test_token",
},
getRegistryHost: func(_ string) (string, error) {
return "", errors.New("invalid hostname")
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ func TestWIProvide_RefreshAAD(t *testing.T) {

func TestWIProvide_Failure_InvalidHostName(t *testing.T) {
provider := &WIAuthProvider{
aadToken: confidential.AuthResult{
AccessToken: "mockToken",
ExpiresOn: time.Now(),
},
tenantID: "mockTenantID",
getRegistryHost: func(_ string) (string, error) {
return "", errors.New("invalid hostname")
},
Expand Down

0 comments on commit aa6be1a

Please sign in to comment.