Skip to content

Commit

Permalink
add buckets name test back
Browse files Browse the repository at this point in the history
  • Loading branch information
sylviamoss committed Jan 24, 2024
1 parent a53295f commit d6d7dba
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions internal/providersdkv2/data_source_packer_bucket_names_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,22 @@ func TestAcc_dataSourcePackerBucketNames(t *testing.T) {
PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) },
ProtoV6ProviderFactories: testProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
PreConfig: func() {
upsertRegistry(t)
},
Config: config,
// If this check fails, there are probably pre-existing buckets
// in the environment that need to be deleted before testing.
// This may also be caused by other tests failing to clean up properly.
Check: resource.TestCheckResourceAttr(bucketNames.BlockName(), "names.#", "0"),
},
{
PreConfig: func() {
upsertBucket(t, bucket0)
},
Config: config,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(bucketNames.BlockName(), "names.#", "1"),
resource.TestCheckResourceAttr(bucketNames.BlockName(), "names.0", bucket0),
),
},
Expand All @@ -39,7 +48,6 @@ func TestAcc_dataSourcePackerBucketNames(t *testing.T) {
},
Config: config,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(bucketNames.BlockName(), "names.#", "3"),
resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr(bucketNames.BlockName(), "names.0", bucket0),
resource.TestCheckResourceAttr(bucketNames.BlockName(), "names.1", bucket1),
Expand Down

0 comments on commit d6d7dba

Please sign in to comment.