Skip to content

Commit

Permalink
Add isVirtualMachineDeployment param to existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JenGoldstrich committed Apr 21, 2023
1 parent bad7f9d commit e37ae65
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions builder/azure/arm/step_deploy_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ func TestStepDeployTemplateShouldTakeStepArgumentsFromStateBag(t *testing.T) {

return nil
},
say: func(message string) {},
error: func(e error) {},
name: "--deployment-name--",
say: func(message string) {},
error: func(e error) {},
name: "--deployment-name--",
isVirtualMachineDeployment: true,
}

stateBag := createTestStateBagStepValidateTemplate()
Expand All @@ -89,9 +90,10 @@ func TestStepDeployTemplateShouldTakeStepArgumentsFromStateBag(t *testing.T) {

func TestStepDeployTemplateDeleteImageShouldFailWhenImageUrlCannotBeParsed(t *testing.T) {
var testSubject = &StepDeployTemplate{
say: func(message string) {},
error: func(e error) {},
name: "--deployment-name--",
say: func(message string) {},
error: func(e error) {},
name: "--deployment-name--",
isVirtualMachineDeployment: true,
}
// Invalid URL per https://golang.org/src/net/url/url_test.go
err := testSubject.deleteImage(context.TODO(), "http://[fe80::1%en0]/", "Unit Test: ResourceGroupName", false)
Expand All @@ -102,9 +104,10 @@ func TestStepDeployTemplateDeleteImageShouldFailWhenImageUrlCannotBeParsed(t *te

func TestStepDeployTemplateDeleteImageShouldFailWithInvalidImage(t *testing.T) {
var testSubject = &StepDeployTemplate{
say: func(message string) {},
error: func(e error) {},
name: "--deployment-name--",
say: func(message string) {},
error: func(e error) {},
name: "--deployment-name--",
isVirtualMachineDeployment: true,
}
err := testSubject.deleteImage(context.TODO(), "storage.blob.core.windows.net/abc", "Unit Test: ResourceGroupName", false)
if err == nil {
Expand Down Expand Up @@ -212,5 +215,6 @@ func createTestStepDeployTemplateDeleteOSImage(deleteDiskCounter *int) *StepDepl
deleteDeployment: func(ctx context.Context, state multistep.StateBag) error {
return nil
},
isVirtualMachineDeployment: true,
}
}

0 comments on commit e37ae65

Please sign in to comment.