Skip to content

Commit

Permalink
Merge pull request #27296 from hashicorp/td-skaff-datasource-errorcheck
Browse files Browse the repository at this point in the history
skaff: Update datasource `ErrorCheck` generation
  • Loading branch information
jar-b authored Oct 18, 2022
2 parents b442125 + c87137b commit 7f77cc5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions skaff/datasource/datasourcetest.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ import (
// any normal context constants, variables, or functions.
{{- end }}
tf{{ .ServicePackage }} "github.com/hashicorp/terraform-provider-aws/internal/service/{{ .ServicePackage }}"
{{- if .AWSGoSDKV2 }}
"github.com/hashicorp/terraform-provider-aws/names"
{{- end }}
)
{{ if .IncludeComments }}
// TIP: File Structure. The basic outline for all test files should be as
Expand Down Expand Up @@ -172,7 +175,11 @@ func TestAcc{{ .Service }}{{ .DataSource }}DataSource_basic(t *testing.T) {
acctest.PreCheckPartitionHasService({{ .ServicePackage }}.EndpointsID, t)
testAccPreCheck(t)
},
{{- if .AWSGoSDKV2 }}
ErrorCheck: acctest.ErrorCheck(t, names.{{ .Service }}EndpointID),
{{- else }}
ErrorCheck: acctest.ErrorCheck(t, {{ .ServicePackage }}.EndpointsID),
{{- end }}
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
CheckDestroy: testAccCheck{{ .DataSource }}Destroy,
Steps: []resource.TestStep{
Expand Down

0 comments on commit 7f77cc5

Please sign in to comment.