opentofu/builtin/providers/digitalocean/import_digitalocean_ssh_key_test.go
Paul Stack ae2bd7a0ff provider/digitalocean: Support Import digitalocean_ssh_key (#7345)
```
make testacc TEST=./builtin/providers/digitalocean
TESTARGS='-run=TestAccDigitalOceanSSHKey_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanSSHKey_ -timeout 120m
=== RUN   TestAccDigitalOceanSSHKey_importBasic
--- PASS: TestAccDigitalOceanSSHKey_importBasic (2.13s)
=== RUN   TestAccDigitalOceanSSHKey_Basic
--- PASS: TestAccDigitalOceanSSHKey_Basic (1.52s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/digitalocean
3.665s
```
2016-06-29 16:09:34 +01:00

29 lines
625 B
Go

package digitalocean
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccDigitalOceanSSHKey_importBasic(t *testing.T) {
resourceName := "digitalocean_ssh_key.foobar"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDigitalOceanSSHKeyDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccCheckDigitalOceanSSHKeyConfig_basic,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}