Skip to content

Commit 11b98cd

Browse files
authored
Remove test dependency on checkpoint api response (#488)
* Remove test dependency on checkpoint api response * fixup! Remove test dependency on checkpoint api response
1 parent 1747074 commit 11b98cd

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

helper/resource/teststep_providers_test.go

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3360,37 +3360,32 @@ func TestTest_TestStep_ProviderFactories_Import_External_With_Data_Source(t *tes
33603360

33613361
Test(t, TestCase{
33623362
ExternalProviders: map[string]ExternalProvider{
3363-
"http": {
3364-
Source: "registry.terraform.io/hashicorp/http",
3363+
"null": {
3364+
Source: "registry.terraform.io/hashicorp/null",
33653365
},
33663366
"random": {
33673367
Source: "registry.terraform.io/hashicorp/random",
33683368
},
33693369
},
33703370
Steps: []TestStep{
33713371
{
3372-
Config: `data "http" "example" {
3373-
url = "https://checkpoint-api.hashicorp.com/v1/check/terraform"
3372+
Config: `
3373+
data "null_data_source" "values" {
3374+
inputs = {
3375+
length = 12
33743376
}
3377+
}
33753378
3376-
resource "random_string" "example" {
3377-
length = length(data.http.example.response_headers)
3378-
}`,
3379+
resource "random_string" "example" {
3380+
length = data.null_data_source.values.outputs["length"]
3381+
}
3382+
`,
33793383
Check: extractResourceAttr("random_string.example", "id", &id),
33803384
},
33813385
{
3382-
Config: `data "http" "example" {
3383-
url = "https://checkpoint-api.hashicorp.com/v1/check/terraform"
3384-
}
3385-
3386-
resource "random_string" "example" {
3387-
length = length(data.http.example.response_headers)
3388-
}`,
3389-
ResourceName: "random_string.example",
3390-
ImportState: true,
3391-
ImportStateCheck: composeImportStateCheck(
3392-
testCheckResourceAttrInstanceState(&id, "length", "12"),
3393-
),
3386+
ResourceName: "random_string.example",
3387+
ImportState: true,
3388+
ImportStateCheck: testCheckResourceAttrInstanceState(&id, "length", "12"),
33943389
ImportStateVerify: true,
33953390
},
33963391
},

0 commit comments

Comments
 (0)