mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-16 03:32:54 -06:00
ae2bd7a0ff
``` 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 ```
29 lines
625 B
Go
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,
|
|
},
|
|
},
|
|
})
|
|
}
|