Skip to content

Commit c75d366

Browse files
committed
Update Import test
Signed-off-by: Timo Sand <[email protected]>
1 parent c984df1 commit c75d366

3 files changed

Lines changed: 9 additions & 14 deletions

File tree

github/data_source_github_repository_pages_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"testing"
66

7-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
8-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7+
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
8+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
99
)
1010

1111
func TestAccGithubRepositoryPagesDataSource(t *testing.T) {

github/resource_github_repository_pages.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func resourceGithubRepositoryPagesDelete(ctx context.Context, d *schema.Resource
265265
func resourceGithubRepositoryPagesImport(ctx context.Context, d *schema.ResourceData, meta any) ([]*schema.ResourceData, error) {
266266
owner, repoName, err := parseID2(d.Id())
267267
if err != nil {
268-
return nil, fmt.Errorf("invalid ID specified: supplied ID must be written as <owner>/<repository>. Original error: %w", err)
268+
return nil, fmt.Errorf("invalid ID specified: supplied ID must be written as <owner>:<repository>. Original error: %w", err)
269269
}
270270
if err := d.Set("owner", owner); err != nil {
271271
return nil, err
@@ -274,12 +274,6 @@ func resourceGithubRepositoryPagesImport(ctx context.Context, d *schema.Resource
274274
return nil, err
275275
}
276276

277-
id, err := buildID(owner, repoName)
278-
if err != nil {
279-
return nil, err
280-
}
281-
d.SetId(id)
282-
283277
return []*schema.ResourceData{d}, nil
284278
}
285279

github/resource_github_repository_pages_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"testing"
66

7-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
8-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7+
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
8+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
99
)
1010

1111
func TestAccGithubRepositoryPages(t *testing.T) {
@@ -167,9 +167,10 @@ source {
167167
),
168168
},
169169
{
170-
ResourceName: "github_repository_pages.test",
171-
ImportState: true,
172-
ImportStateVerify: true,
170+
ResourceName: "github_repository_pages.test",
171+
ImportState: true,
172+
ImportStateVerify: true,
173+
ImportStateVerifyIgnore: []string{"build_status"},
173174
},
174175
},
175176
})

0 commit comments

Comments
 (0)