From 6786c0d6415b0348ebfce22a93be7bf51ad4d212 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 30 May 2019 16:17:23 -0500 Subject: [PATCH] update tests to reflect new behavior --- .../amazon/common/step_ami_region_copy_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/builder/amazon/common/step_ami_region_copy_test.go b/builder/amazon/common/step_ami_region_copy_test.go index 7428d63b5..bd3c4fed0 100644 --- a/builder/amazon/common/step_ami_region_copy_test.go +++ b/builder/amazon/common/step_ami_region_copy_test.go @@ -101,11 +101,11 @@ func TestStepAmiRegionCopy_nil_encryption(t *testing.T) { state := tState() stepAMIRegionCopy.Run(context.Background(), state) - if stepAMIRegionCopy.toDelete != "" { - t.Fatalf("Shouldn't delete original AMI if not encrypted") + if stepAMIRegionCopy.toDelete != "ami-12345" { + t.Fatalf("Should delete original intermediary ami even if not encrypted") } - if len(stepAMIRegionCopy.Regions) > 0 { - t.Fatalf("Shouldn't have added original ami to original region") + if len(stepAMIRegionCopy.Regions) == 0 { + t.Fatalf("Should have added original ami to original region") } } @@ -126,11 +126,11 @@ func TestStepAmiRegionCopy_false_encryption(t *testing.T) { state := tState() stepAMIRegionCopy.Run(context.Background(), state) - if stepAMIRegionCopy.toDelete != "" { - t.Fatalf("Shouldn't delete original AMI if not encrypted") + if stepAMIRegionCopy.toDelete != "ami-12345" { + t.Fatalf("should be deleting the original intermediary ami") } - if len(stepAMIRegionCopy.Regions) > 0 { - t.Fatalf("Shouldn't have added original ami to Regions") + if len(stepAMIRegionCopy.Regions) == 0 { + t.Fatalf("Should have added original ami to Regions") } }