github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/builtin/providers/aws/import_aws_codepipeline_test.go (about)

     1  package aws
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  
     7  	"github.com/hashicorp/terraform/helper/acctest"
     8  	"github.com/hashicorp/terraform/helper/resource"
     9  )
    10  
    11  func TestAccAWSCodePipeline_Import_basic(t *testing.T) {
    12  	if os.Getenv("GITHUB_TOKEN") == "" {
    13  		t.Skip("Environment variable GITHUB_TOKEN is not set")
    14  	}
    15  
    16  	name := acctest.RandString(10)
    17  
    18  	resource.Test(t, resource.TestCase{
    19  		PreCheck:     func() { testAccPreCheck(t) },
    20  		Providers:    testAccProviders,
    21  		CheckDestroy: testAccCheckAWSCodePipelineDestroy,
    22  		Steps: []resource.TestStep{
    23  			resource.TestStep{
    24  				Config: testAccAWSCodePipelineConfig_basic(name),
    25  			},
    26  
    27  			resource.TestStep{
    28  				ResourceName:      "aws_codepipeline.bar",
    29  				ImportState:       true,
    30  				ImportStateVerify: true,
    31  			},
    32  		},
    33  	})
    34  }