mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-08 15:13:56 -06:00
e272cb2243
Fixes failing acceptance test: ``` $ make testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanVolume_Droplet' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/01/20 11:38:26 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/digitalocean -v -run=TestAccDigitalOceanVolume_Droplet -timeout 120m === RUN TestAccDigitalOceanVolume_Droplet --- PASS: TestAccDigitalOceanVolume_Droplet (57.38s) PASS ok github.com/hashicorp/terraform/builtin/providers/digitalocean 57.411s ``` Also removes all redundant type declarations in the digitalocean package.
33 lines
736 B
Go
33 lines
736 B
Go
package digitalocean
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"fmt"
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccDigitalOceanVolume_importBasic(t *testing.T) {
|
|
resourceName := "digitalocean_volume.foobar"
|
|
volumeName := fmt.Sprintf("volume-%s", acctest.RandString(10))
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckDigitalOceanVolumeDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: fmt.Sprintf(testAccCheckDigitalOceanVolumeConfig_basic, volumeName),
|
|
},
|
|
|
|
{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|