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