Skip to content

Commit

Permalink
Change naming according to hashicorp#9950
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzegorz Szczudlik committed Mar 31, 2020
1 parent 5da82fb commit efaaae6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions aws/data_source_aws_regions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

func TestAccDataSourceAwsRegionsBasic(t *testing.T) {
func TestAccDataSourceAwsRegions_Basic(t *testing.T) {
resourceName := "data.aws_regions.empty"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccDataSourceAwsRegionsConfigEmpty(),
Config: testAccDataSourceAwsRegionsConfig_empty(),
Check: resource.ComposeTestCheckFunc(
testAccDataSourceAwsRegionsCheck(resourceName),
resource.TestCheckNoResourceAttr(resourceName, "all_regions"),
Expand All @@ -26,7 +26,7 @@ func TestAccDataSourceAwsRegionsBasic(t *testing.T) {
})
}

func TestAccDataSourceAwsRegionsOptIn(t *testing.T) {
func TestAccDataSourceAwsRegions_OptIn(t *testing.T) {
resourceName := "data.aws_regions.opt_in_status"

statusOptedIn := "opted-in"
Expand All @@ -39,21 +39,21 @@ func TestAccDataSourceAwsRegionsOptIn(t *testing.T) {
Steps: []resource.TestStep{
// This resource has to be at the very top of the test scenario due to bug in Terrafom Plugin SDK
{
Config: testAccDataSourceAwsRegionsConfigAllRegionsFiltered(statusOptedIn),
Config: testAccDataSourceAwsRegionsConfig_allRegionsFiltered(statusOptedIn),
Check: resource.ComposeTestCheckFunc(
testAccDataSourceAwsRegionsCheck(resourceName),
resource.TestCheckNoResourceAttr(resourceName, "all_regions"),
),
},
{
Config: testAccDataSourceAwsRegionsConfigAllRegionsFiltered(statusOptInNotRequired),
Config: testAccDataSourceAwsRegionsConfig_allRegionsFiltered(statusOptInNotRequired),
Check: resource.ComposeTestCheckFunc(
testAccDataSourceAwsRegionsCheck(resourceName),
resource.TestCheckNoResourceAttr(resourceName, "all_regions"),
),
},
{
Config: testAccDataSourceAwsRegionsConfigAllRegionsFiltered(statusNotOptedIn),
Config: testAccDataSourceAwsRegionsConfig_allRegionsFiltered(statusNotOptedIn),
Check: resource.ComposeTestCheckFunc(
testAccDataSourceAwsRegionsCheck(resourceName),
resource.TestCheckNoResourceAttr(resourceName, "all_regions"),
Expand All @@ -63,15 +63,15 @@ func TestAccDataSourceAwsRegionsOptIn(t *testing.T) {
})
}

func TestAccDataSourceAwsRegionsAllRegions(t *testing.T) {
func TestAccDataSourceAwsRegions_AllRegions(t *testing.T) {
resourceAllRegions := "data.aws_regions.all_regions"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccDataSourceAwsRegionsConfigAllRegions(),
Config: testAccDataSourceAwsRegionsConfig_allRegions(),
Check: resource.ComposeTestCheckFunc(
testAccDataSourceAwsRegionsCheck(resourceAllRegions),
resource.TestCheckResourceAttr(resourceAllRegions, "all_regions", "true"),
Expand All @@ -93,21 +93,21 @@ func testAccDataSourceAwsRegionsCheck(name string) resource.TestCheckFunc {
}
}

func testAccDataSourceAwsRegionsConfigEmpty() string {
func testAccDataSourceAwsRegionsConfig_empty() string {
return `
data "aws_regions" "empty" {}
`
}

func testAccDataSourceAwsRegionsConfigAllRegions() string {
func testAccDataSourceAwsRegionsConfig_allRegions() string {
return `
data "aws_regions" "all_regions" {
all_regions = "true"
}
`
}

func testAccDataSourceAwsRegionsConfigAllRegionsFiltered(filter string) string {
func testAccDataSourceAwsRegionsConfig_allRegionsFiltered(filter string) string {
return fmt.Sprintf(`
data "aws_regions" "opt_in_status" {
filter {
Expand Down

0 comments on commit efaaae6

Please sign in to comment.