terraform/builtin/providers/digitalocean/import_digitalocean_droplet...

31 lines
757 B
Go
Raw Normal View History

package digitalocean
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccDigitalOceanDroplet_importBasic(t *testing.T) {
resourceName := "digitalocean_droplet.foobar"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDigitalOceanDropletDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckDigitalOceanDropletConfig_basic,
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"ssh_keys", "user_data", "resize_disk"}, //we ignore the ssh_keys, resize_disk and user_data as we do not set to state
},
},
})
}