Skip to content

Commit

Permalink
fix: Correct regions -> region in the ACC test
Browse files Browse the repository at this point in the history
  • Loading branch information
serdardalgic committed Jul 10, 2023
1 parent c6c9b0f commit 2f9857d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pkg/provider/data_source_region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,38 @@ import (
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccDataSourceRegions_basic(t *testing.T) {
func TestAccDataSourceRegion_basic(t *testing.T) {
var (
acc_env_vars_checklist = []string{
"BA_TF_ACC_VAR_regions_project_id",
"BA_TF_ACC_VAR_regions_provider",
"BA_TF_ACC_VAR_regions_region_id",
"BA_TF_ACC_VAR_region_project_id",
"BA_TF_ACC_VAR_region_provider",
"BA_TF_ACC_VAR_region_region_id",
}
projectId = os.Getenv("BA_TF_ACC_VAR_regions_project_id")
provider = os.Getenv("BA_TF_ACC_VAR_regions_provider")
regionId = os.Getenv("BA_TF_ACC_VAR_regions_region_id")
projectId = os.Getenv("BA_TF_ACC_VAR_region_project_id")
provider = os.Getenv("BA_TF_ACC_VAR_region_provider")
regionId = os.Getenv("BA_TF_ACC_VAR_region_region_id")
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccResourcePreCheck(t, "datasource regions", acc_env_vars_checklist)
testAccResourcePreCheck(t, "datasource region", acc_env_vars_checklist)
},
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
Config: regionsDataSourceConfig(projectId, provider, regionId),
Config: regionDataSourceConfig(projectId, provider, regionId),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrPair("data.biganimal_regions.test", "regions.0.name", "biganimal_regions.test", "name"),
resource.TestCheckResourceAttrPair("data.biganimal_regions.test", "regions.0.status", "biganimal_regions.test", "status"),
resource.TestCheckResourceAttrPair("data.biganimal_region.test", "region.0.name", "biganimal_region.test", "name"),
resource.TestCheckResourceAttrPair("data.biganimal_region.test", "region.0.status", "biganimal_region.test", "status"),
),
},
},
})
}

func regionsDataSourceConfig(projectId, provider, regionId string) string {
return fmt.Sprintf(`data "biganimal_regions" "test" {
func regionDataSourceConfig(projectId, provider, regionId string) string {
return fmt.Sprintf(`data "biganimal_region" "test" {
project_id = "%[1]s"
cloud_provider = "%[2]s"
region_id = "%[3]s"
Expand Down

0 comments on commit 2f9857d

Please sign in to comment.