provider/digitalocean: Add Test for DO Tag Import (#7602)

```
% make testacc TEST=./builtin/providers/digitalocean TESTARGS='-run=TestAccDigitalOceanTag_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/digitalocean -v
-run=TestAccDigitalOceanTag_ -timeout 120m
=== RUN   TestAccDigitalOceanTag_importBasic
--- PASS: TestAccDigitalOceanTag_importBasic (2.42s)
=== RUN   TestAccDigitalOceanTag_Basic
--- PASS: TestAccDigitalOceanTag_Basic (1.72s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/digitalocean
4.151s
```
This commit is contained in:
Paul Stack 2016-07-12 13:16:34 +01:00 committed by GitHub
parent 7a58ad95f5
commit 4582cbeb5e
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package digitalocean
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccDigitalOceanTag_importBasic(t *testing.T) {
resourceName := "digitalocean_tag.foobar"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDigitalOceanTagDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccCheckDigitalOceanTagConfig_basic,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}