From 4582cbeb5e30e61aa398eae4ea51215681642e4c Mon Sep 17 00:00:00 2001 From: Paul Stack Date: Tue, 12 Jul 2016 13:16:34 +0100 Subject: [PATCH] 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 ``` --- .../import_digitalocean_tag_test.go | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 builtin/providers/digitalocean/import_digitalocean_tag_test.go diff --git a/builtin/providers/digitalocean/import_digitalocean_tag_test.go b/builtin/providers/digitalocean/import_digitalocean_tag_test.go new file mode 100644 index 000000000..9199f54a3 --- /dev/null +++ b/builtin/providers/digitalocean/import_digitalocean_tag_test.go @@ -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, + }, + }, + }) +}