github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/digitalocean/import_digitalocean_floating_ip_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 TestAccDigitalOceanFloatingIP_importBasicRegion(t *testing.T) {
    11  	resourceName := "digitalocean_floating_ip.foobar"
    12  
    13  	resource.Test(t, resource.TestCase{
    14  		PreCheck:     func() { testAccPreCheck(t) },
    15  		Providers:    testAccProviders,
    16  		CheckDestroy: testAccCheckDigitalOceanFloatingIPDestroy,
    17  		Steps: []resource.TestStep{
    18  			{
    19  				Config: testAccCheckDigitalOceanFloatingIPConfig_region,
    20  			},
    21  
    22  			{
    23  				ResourceName:      resourceName,
    24  				ImportState:       true,
    25  				ImportStateVerify: true,
    26  			},
    27  		},
    28  	})
    29  }
    30  
    31  func TestAccDigitalOceanFloatingIP_importBasicDroplet(t *testing.T) {
    32  	resourceName := "digitalocean_floating_ip.foobar"
    33  	rInt := acctest.RandInt()
    34  
    35  	resource.Test(t, resource.TestCase{
    36  		PreCheck:     func() { testAccPreCheck(t) },
    37  		Providers:    testAccProviders,
    38  		CheckDestroy: testAccCheckDigitalOceanFloatingIPDestroy,
    39  		Steps: []resource.TestStep{
    40  			{
    41  				Config: testAccCheckDigitalOceanFloatingIPConfig_droplet(rInt),
    42  			},
    43  
    44  			{
    45  				ResourceName:      resourceName,
    46  				ImportState:       true,
    47  				ImportStateVerify: true,
    48  			},
    49  		},
    50  	})
    51  }