34 lines
836 B
Go
34 lines
836 B
Go
![]() |
package digitalocean
|
||
|
|
||
|
import (
|
||
![]() |
"fmt"
|
||
![]() |
"testing"
|
||
|
|
||
![]() |
"github.com/hashicorp/terraform/helper/acctest"
|
||
![]() |
"github.com/hashicorp/terraform/helper/resource"
|
||
|
)
|
||
|
|
||
|
func TestAccDigitalOceanBucket_importBasic(t *testing.T) {
|
||
![]() |
resourceName := "digitalocean_spaces_bucket.bucket"
|
||
![]() |
rInt := acctest.RandInt()
|
||
![]() |
|
||
|
resource.Test(t, resource.TestCase{
|
||
|
PreCheck: func() { testAccPreCheck(t) },
|
||
|
Providers: testAccProviders,
|
||
|
CheckDestroy: testAccCheckDigitalOceanBucketDestroy,
|
||
|
Steps: []resource.TestStep{
|
||
|
{
|
||
![]() |
Config: testAccDigitalOceanBucketConfigImport(rInt),
|
||
![]() |
},
|
||
|
|
||
|
{
|
||
![]() |
ResourceName: resourceName,
|
||
|
ImportState: true,
|
||
|
ImportStateVerify: true,
|
||
|
ImportStateIdPrefix: fmt.Sprintf("%s,", "nyc3"),
|
||
|
ImportStateVerifyIgnore: []string{"acl"}, // ACLs are not saved to tf state
|
||
![]() |
},
|
||
|
},
|
||
|
})
|
||
|
}
|