github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/datadog/import_datadog_downtime_test.go (about) 1 package datadog 2 3 import ( 4 "testing" 5 6 "github.com/hashicorp/terraform/helper/resource" 7 ) 8 9 func TestDatadogDowntime_import(t *testing.T) { 10 resourceName := "datadog_downtime.foo" 11 12 resource.Test(t, resource.TestCase{ 13 PreCheck: func() { testAccPreCheck(t) }, 14 Providers: testAccProviders, 15 CheckDestroy: testAccCheckDatadogDowntimeDestroy, 16 Steps: []resource.TestStep{ 17 resource.TestStep{ 18 Config: testAccCheckDatadogDowntimeConfigImported, 19 }, 20 resource.TestStep{ 21 ResourceName: resourceName, 22 ImportState: true, 23 ImportStateVerify: true, 24 }, 25 }, 26 }) 27 } 28 29 const testAccCheckDatadogDowntimeConfigImported = ` 30 resource "datadog_downtime" "foo" { 31 scope = ["host:X", "host:Y"] 32 start = 1735707600 33 end = 1735765200 34 35 message = "Example Datadog downtime message." 36 } 37 `