Skip to content

Commit

Permalink
s/TestAccGoogle/TestAcc/ (#1121)
Browse files Browse the repository at this point in the history
* s/TestAccGoogle/TestAcc/

* add back import

* reorder imports
  • Loading branch information
danawillow authored Feb 23, 2018
1 parent 640e259 commit 6d0b87e
Show file tree
Hide file tree
Showing 48 changed files with 428 additions and 418 deletions.
2 changes: 1 addition & 1 deletion google/data_source_google_compute_zones_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/terraform/terraform"
)

func TestAccGoogleComputeZones_basic(t *testing.T) {
func TestAccComputeZones_basic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
Expand Down
2 changes: 1 addition & 1 deletion google/data_source_google_container_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/terraform/terraform"
)

func TestAccGoogleContainerClusterDatasource_basic(t *testing.T) {
func TestAccContainerClusterDatasource_basic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/terraform/terraform"
)

func TestAccGoogleContainerEngineVersions_basic(t *testing.T) {
func TestAccContainerEngineVersions_basic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
Expand Down
4 changes: 2 additions & 2 deletions google/data_source_google_kms_secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package google
import (
"encoding/base64"
"fmt"
"log"
"testing"

"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"google.golang.org/api/cloudkms/v1"
"log"
)

func TestAccGoogleKmsSecret_basic(t *testing.T) {
func TestAccKmsSecret_basic(t *testing.T) {
t.Parallel()

projectOrg := getTestOrgFromEnv(t)
Expand Down
14 changes: 7 additions & 7 deletions google/data_source_storage_object_signed_url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestAccStorageSignedUrl_basic(t *testing.T) {
resource.TestStep{
Config: testGoogleSignedUrlConfig,
Check: resource.ComposeTestCheckFunc(
testAccGoogleSignedUrlExists("data.google_storage_object_signed_url.blerg"),
testAccSignedUrlExists("data.google_storage_object_signed_url.blerg"),
),
},
},
Expand All @@ -133,17 +133,17 @@ func TestAccStorageSignedUrl_accTest(t *testing.T) {
resource.TestStep{
Config: testAccTestGoogleStorageObjectSignedURL(bucketName),
Check: resource.ComposeTestCheckFunc(
testAccGoogleSignedUrlRetrieval("data.google_storage_object_signed_url.story_url", nil),
testAccGoogleSignedUrlRetrieval("data.google_storage_object_signed_url.story_url_w_headers", headers),
testAccGoogleSignedUrlRetrieval("data.google_storage_object_signed_url.story_url_w_content_type", nil),
testAccGoogleSignedUrlRetrieval("data.google_storage_object_signed_url.story_url_w_md5", nil),
testAccSignedUrlRetrieval("data.google_storage_object_signed_url.story_url", nil),
testAccSignedUrlRetrieval("data.google_storage_object_signed_url.story_url_w_headers", headers),
testAccSignedUrlRetrieval("data.google_storage_object_signed_url.story_url_w_content_type", nil),
testAccSignedUrlRetrieval("data.google_storage_object_signed_url.story_url_w_md5", nil),
),
},
},
})
}

func testAccGoogleSignedUrlExists(n string) resource.TestCheckFunc {
func testAccSignedUrlExists(n string) resource.TestCheckFunc {
return func(s *terraform.State) error {

r := s.RootModule().Resources[n]
Expand All @@ -157,7 +157,7 @@ func testAccGoogleSignedUrlExists(n string) resource.TestCheckFunc {
}
}

func testAccGoogleSignedUrlRetrieval(n string, headers map[string]string) resource.TestCheckFunc {
func testAccSignedUrlRetrieval(n string, headers map[string]string) resource.TestCheckFunc {
return func(s *terraform.State) error {
r := s.RootModule().Resources[n]
if r == nil {
Expand Down
2 changes: 1 addition & 1 deletion google/import_container_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccGoogleContainerNodePool_import(t *testing.T) {
func TestAccContainerNodePool_import(t *testing.T) {
t.Parallel()

resourceName := "google_container_node_pool.np"
Expand Down
4 changes: 2 additions & 2 deletions google/import_google_kms_crypto_key_iam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestAccKmsCryptoKeyIamMember_importBasic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleKmsCryptoKeyIamMember_basic(projectId, orgId, billingAccount, account, keyRingName, cryptoKeyName, roleId),
Config: testAccKmsCryptoKeyIamMember_basic(projectId, orgId, billingAccount, account, keyRingName, cryptoKeyName, roleId),
},

resource.TestStep{
Expand Down Expand Up @@ -62,7 +62,7 @@ func TestAccKmsCryptoKeyIamBinding_importBasic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleKmsCryptoKeyIamBinding_basic(projectId, orgId, billingAccount, account, keyRingName, cryptoKeyName, roleId),
Config: testAccKmsCryptoKeyIamBinding_basic(projectId, orgId, billingAccount, account, keyRingName, cryptoKeyName, roleId),
},

resource.TestStep{
Expand Down
6 changes: 3 additions & 3 deletions google/import_google_kms_key_ring_iam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestAccKmsKeyRingIamMember_importBasic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleKmsKeyRingIamMember_basic(projectId, orgId, billingAccount, account, keyRingName, roleId),
Config: testAccKmsKeyRingIamMember_basic(projectId, orgId, billingAccount, account, keyRingName, roleId),
},

resource.TestStep{
Expand Down Expand Up @@ -60,7 +60,7 @@ func TestAccKmsKeyRingIamPolicy_importBasic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleKmsKeyRingIamPolicy_basic(projectId, orgId, billingAccount, account, keyRingName, roleId),
Config: testAccKmsKeyRingIamPolicy_basic(projectId, orgId, billingAccount, account, keyRingName, roleId),
},

resource.TestStep{
Expand Down Expand Up @@ -91,7 +91,7 @@ func TestAccKmsKeyRingIamBinding_importBasic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleKmsKeyRingIamBinding_basic(projectId, orgId, billingAccount, account, keyRingName, roleId),
Config: testAccKmsKeyRingIamBinding_basic(projectId, orgId, billingAccount, account, keyRingName, roleId),
},

resource.TestStep{
Expand Down
8 changes: 4 additions & 4 deletions google/import_google_organization_iam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccGoogleOrganizationIamMember_importBasic(t *testing.T) {
func TestAccOrganizationIamMember_importBasic(t *testing.T) {
t.Parallel()

orgId := getTestOrgFromEnv(t)
Expand All @@ -20,7 +20,7 @@ func TestAccGoogleOrganizationIamMember_importBasic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleOrganizationIamMember_basic(account, orgId),
Config: testAccOrganizationIamMember_basic(account, orgId),
},

resource.TestStep{
Expand All @@ -32,7 +32,7 @@ func TestAccGoogleOrganizationIamMember_importBasic(t *testing.T) {
})
}

func TestAccGoogleOrganizationIamBinding_importBasic(t *testing.T) {
func TestAccOrganizationIamBinding_importBasic(t *testing.T) {
t.Parallel()

orgId := getTestOrgFromEnv(t)
Expand All @@ -44,7 +44,7 @@ func TestAccGoogleOrganizationIamBinding_importBasic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleOrganizationIamBinding_basic(account, roleId, orgId),
Config: testAccOrganizationIamBinding_basic(account, roleId, orgId),
},

resource.TestStep{
Expand Down
5 changes: 3 additions & 2 deletions google/import_google_project_iam_custom_role_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package google

import (
"testing"

"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"testing"
)

func TestAccGoogleProjectIamCustomRole_import(t *testing.T) {
func TestAccProjectIamCustomRole_import(t *testing.T) {
t.Parallel()

roleId := "tfIamRole" + acctest.RandString(10)
Expand Down
8 changes: 4 additions & 4 deletions google/import_google_project_iam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccGoogleProjectIamMember_importBasic(t *testing.T) {
func TestAccProjectIamMember_importBasic(t *testing.T) {
t.Parallel()

resourceName := "google_project_iam_member.acceptance"
Expand All @@ -20,7 +20,7 @@ func TestAccGoogleProjectIamMember_importBasic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleProjectAssociateMemberBasic(pid, "Acceptance", org),
Config: testAccProjectAssociateMemberBasic(pid, "Acceptance", org),
},

resource.TestStep{
Expand All @@ -32,7 +32,7 @@ func TestAccGoogleProjectIamMember_importBasic(t *testing.T) {
})
}

func TestAccGoogleProjectIamBinding_importBasic(t *testing.T) {
func TestAccProjectIamBinding_importBasic(t *testing.T) {
t.Parallel()

resourceName := "google_project_iam_binding.acceptance"
Expand All @@ -44,7 +44,7 @@ func TestAccGoogleProjectIamBinding_importBasic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleProjectAssociateBindingBasic(pid, "Acceptance", org),
Config: testAccProjectAssociateBindingBasic(pid, "Acceptance", org),
},

resource.TestStep{
Expand Down
4 changes: 2 additions & 2 deletions google/import_google_project_services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccGoogleProjectServices_importBasic(t *testing.T) {
func TestAccProjectServices_importBasic(t *testing.T) {
t.Parallel()

org := getTestOrgFromEnv(t)
resourceName := "google_project_services.acceptance"
projectId := "terraform-" + acctest.RandString(10)
services := []string{"iam.googleapis.com", "cloudresourcemanager.googleapis.com", "servicemanagement.googleapis.com"}

conf := testAccGoogleProjectAssociateServicesBasic(services, projectId, pname, org)
conf := testAccProjectAssociateServicesBasic(services, projectId, pname, org)

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down
12 changes: 6 additions & 6 deletions google/import_google_service_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccGoogleServiceAccount_importBasic(t *testing.T) {
func TestAccServiceAccount_importBasic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleServiceAccount_import("terraform-" + acctest.RandString(10)),
Config: testAccServiceAccount_import("terraform-" + acctest.RandString(10)),
},

resource.TestStep{
Expand All @@ -28,23 +28,23 @@ func TestAccGoogleServiceAccount_importBasic(t *testing.T) {
})
}

func testAccGoogleServiceAccount_import(saName string) string {
func testAccServiceAccount_import(saName string) string {
return fmt.Sprintf(`
resource "google_service_account" "acceptance" {
account_id = "%s"
display_name = "%s"
}`, saName, saName)
}

func TestAccGoogleServiceAccount_importWithProject(t *testing.T) {
func TestAccServiceAccount_importWithProject(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccGoogleServiceAccount_importWithProject(getTestProjectFromEnv(), "terraform-"+acctest.RandString(10)),
Config: testAccServiceAccount_importWithProject(getTestProjectFromEnv(), "terraform-"+acctest.RandString(10)),
},

resource.TestStep{
Expand All @@ -56,7 +56,7 @@ func TestAccGoogleServiceAccount_importWithProject(t *testing.T) {
})
}

func testAccGoogleServiceAccount_importWithProject(project, saName string) string {
func testAccServiceAccount_importWithProject(project, saName string) string {
return fmt.Sprintf(`
resource "google_service_account" "acceptance" {
project = "%s"
Expand Down
4 changes: 2 additions & 2 deletions google/import_kms_crypto_key_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package google

import (
"fmt"
"testing"

"fmt"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccGoogleKmsCryptoKey_importBasic(t *testing.T) {
func TestAccKmsCryptoKey_importBasic(t *testing.T) {
t.Parallel()

resourceName := "google_kms_crypto_key.crypto_key"
Expand Down
4 changes: 2 additions & 2 deletions google/import_kms_key_ring_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package google

import (
"fmt"
"testing"

"fmt"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccGoogleKmsKeyRing_importBasic(t *testing.T) {
func TestAccKmsKeyRing_importBasic(t *testing.T) {
resourceName := "google_kms_key_ring.key_ring"

projectId := "terraform-" + acctest.RandString(10)
Expand Down
8 changes: 4 additions & 4 deletions google/import_sql_database_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Test importing a first generation database
func TestAccGoogleSqlDatabaseInstance_importBasic(t *testing.T) {
func TestAccSqlDatabaseInstance_importBasic(t *testing.T) {
t.Parallel()

resourceName := "google_sql_database_instance.instance"
Expand All @@ -18,7 +18,7 @@ func TestAccGoogleSqlDatabaseInstance_importBasic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccGoogleSqlDatabaseInstanceDestroy,
CheckDestroy: testAccSqlDatabaseInstanceDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(
Expand All @@ -35,7 +35,7 @@ func TestAccGoogleSqlDatabaseInstance_importBasic(t *testing.T) {
}

// Test importing a second generation database
func TestAccGoogleSqlDatabaseInstance_importBasic3(t *testing.T) {
func TestAccSqlDatabaseInstance_importBasic3(t *testing.T) {
t.Parallel()

resourceName := "google_sql_database_instance.instance"
Expand All @@ -44,7 +44,7 @@ func TestAccGoogleSqlDatabaseInstance_importBasic3(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccGoogleSqlDatabaseInstanceDestroy,
CheckDestroy: testAccSqlDatabaseInstanceDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(
Expand Down
4 changes: 2 additions & 2 deletions google/import_sql_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccGoogleSqlDatabase_importBasic(t *testing.T) {
func TestAccSqlDatabase_importBasic(t *testing.T) {
t.Parallel()

resourceName := "google_sql_database.database"

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccGoogleSqlDatabaseInstanceDestroy,
CheckDestroy: testAccSqlDatabaseInstanceDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(
Expand Down
Loading

0 comments on commit 6d0b87e

Please sign in to comment.