terraform-provider-google/google/import_compute_project_metadata_item_test.go
Joe Selman c6ae260d63 Use a unique key when running project_metadata_item import tests (#274)
CI runs tests concurrently and will interfere with each other with the
current global key name.
2017-08-01 11:14:13 -07:00

29 lines
675 B
Go

package google
import (
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccComputeProjectMetadataItem_importBasic(t *testing.T) {
key := "myKey" + acctest.RandString(10)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckProjectMetadataItemDestroy,
Steps: []resource.TestStep{
{
Config: testAccProjectMetadataItem_basic(key, "myValue"),
},
{
ResourceName: "google_compute_project_metadata_item.foobar",
ImportState: true,
ImportStateVerify: true,
},
},
})
}