Skip to content

Commit

Permalink
Remove TestDeleteBlob UT
Browse files Browse the repository at this point in the history
Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
  • Loading branch information
lzhecheng committed Jan 20, 2022
1 parent 8f55da8 commit 5b99b58
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions cluster-autoscaler/cloudprovider/azure/azure_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,11 @@ import (
"time"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-12-01/compute"
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-02-01/storage"
"github.com/Azure/go-autorest/autorest/to"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"

"sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/mockstorageaccountclient"
"sigs.k8s.io/cloud-provider-azure/pkg/retry"
)

const (
testAccountName = "account"
// TODO(nilo19): verify if DeleteBlob unit test needs to check error string, and which message is expected. We saw both:
// storageAccountClientErrMsg = "Server failed to authenticate the request. Make sure the value of Authorization " +
// "header is formed correctly including the signature"
// storageAccountClientErrMsg = "The specified account is disabled"
)

func GetTestAzureUtil(t *testing.T) *AzUtil {
return &AzUtil{manager: newTestAzureManager(t)}
}
Expand Down Expand Up @@ -303,26 +291,6 @@ func TestIsAzureRequestsThrottled(t *testing.T) {
}
}

func TestDeleteBlob(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

azUtil := GetTestAzureUtil(t)
mockSAClient := mockstorageaccountclient.NewMockInterface(ctrl)
mockSAClient.EXPECT().ListKeys(
gomock.Any(),
azUtil.manager.config.ResourceGroup,
testAccountName).Return(storage.AccountListKeysResult{
Keys: &[]storage.AccountKey{
{Value: to.StringPtr("dmFsdWUK")},
},
}, nil)
azUtil.manager.azClient.storageAccountsClient = mockSAClient

err := azUtil.DeleteBlob(testAccountName, "vhd", "blob")
assert.Error(t, err)
}

func TestNormalizeMasterResourcesForScaling(t *testing.T) {
templateMap := map[string]interface{}{
resourcesFieldName: []interface{}{
Expand Down

0 comments on commit 5b99b58

Please sign in to comment.