github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/digitalocean/import_digitalocean_droplet_test.go (about)

     1  package digitalocean
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/hashicorp/terraform/helper/acctest"
     7  	"github.com/hashicorp/terraform/helper/resource"
     8  )
     9  
    10  func TestAccDigitalOceanDroplet_importBasic(t *testing.T) {
    11  	resourceName := "digitalocean_droplet.foobar"
    12  	rInt := acctest.RandInt()
    13  
    14  	resource.Test(t, resource.TestCase{
    15  		PreCheck:     func() { testAccPreCheck(t) },
    16  		Providers:    testAccProviders,
    17  		CheckDestroy: testAccCheckDigitalOceanDropletDestroy,
    18  		Steps: []resource.TestStep{
    19  			{
    20  				Config: testAccCheckDigitalOceanDropletConfig_basic(rInt),
    21  			},
    22  
    23  			{
    24  				ResourceName:      resourceName,
    25  				ImportState:       true,
    26  				ImportStateVerify: true,
    27  				ImportStateVerifyIgnore: []string{
    28  					"ssh_keys", "user_data", "resize_disk"}, //we ignore the ssh_keys, resize_disk and user_data as we do not set to state
    29  			},
    30  		},
    31  	})
    32  }