Skip to content

Commit

Permalink
skaff: update datasource ErrorCheck generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jar-b committed Oct 18, 2022
1 parent 238ded4 commit c87137b
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 c87137b

Please sign in to comment.