github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/builtin/providers/digitalocean/import_digitalocean_ssh_key_test.go (about) 1 package digitalocean 2 3 import ( 4 "testing" 5 6 "github.com/hashicorp/terraform/helper/resource" 7 ) 8 9 func TestAccDigitalOceanSSHKey_importBasic(t *testing.T) { 10 resourceName := "digitalocean_ssh_key.foobar" 11 12 resource.Test(t, resource.TestCase{ 13 PreCheck: func() { testAccPreCheck(t) }, 14 Providers: testAccProviders, 15 CheckDestroy: testAccCheckDigitalOceanSSHKeyDestroy, 16 Steps: []resource.TestStep{ 17 { 18 Config: testAccCheckDigitalOceanSSHKeyConfig_basic(testAccValidImportPublicKey), 19 }, 20 21 { 22 ResourceName: resourceName, 23 ImportState: true, 24 ImportStateVerify: true, 25 }, 26 }, 27 }) 28 }