github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/profitbricks/data_source_location_test.go (about) 1 package profitbricks 2 3 import ( 4 "github.com/hashicorp/terraform/helper/resource" 5 "testing" 6 ) 7 8 func TestAccDataSourceLocation_basic(t *testing.T) { 9 resource.Test(t, resource.TestCase{ 10 PreCheck: func() { 11 testAccPreCheck(t) 12 }, 13 Providers: testAccProviders, 14 Steps: []resource.TestStep{ 15 { 16 17 Config: testAccDataSourceProfitBricksLocation_basic, 18 Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttr("data.profitbricks_location.loc", "id", "de/fkb"), 19 resource.TestCheckResourceAttr("data.profitbricks_location.loc", "name", "karlsruhe"), 20 ), 21 }, 22 }, 23 }) 24 25 } 26 27 const testAccDataSourceProfitBricksLocation_basic = ` 28 data "profitbricks_location" "loc" { 29 name = "karlsruhe" 30 feature = "SSD" 31 } 32 `