terraform/builtin/providers/pagerduty/import_pagerduty_user_test.go

32 lines
699 B
Go
Raw Normal View History

2016-09-23 21:43:06 +02:00
package pagerduty
import (
"fmt"
2016-09-23 21:43:06 +02:00
"testing"
"github.com/hashicorp/terraform/helper/acctest"
2016-09-23 21:43:06 +02:00
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccPagerDutyUser_import(t *testing.T) {
username := fmt.Sprintf("tf-%s", acctest.RandString(5))
email := fmt.Sprintf("%s@foo.com", username)
2016-10-16 16:48:20 +02:00
2016-09-23 21:43:06 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckPagerDutyUserDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckPagerDutyUserConfig(username, email),
2016-09-23 21:43:06 +02:00
},
2016-10-16 16:48:20 +02:00
{
ResourceName: "pagerduty_user.foo",
2016-09-23 21:43:06 +02:00
ImportState: true,
ImportStateVerify: true,
},
},
})
}