Skip to content

Commit d065ac4

Browse files
committed
Tidy importstate/testdata
1 parent 52cc5ee commit d065ac4

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

helper/resource/importstate/import_block_in_config_directory_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
r "github.com/hashicorp/terraform-plugin-testing/helper/resource"
1717
)
1818

19-
func TestImportBlock_InConfigDirectory_ConfigExactTrue(t *testing.T) {
19+
func TestImportBlock_InConfigDirectory(t *testing.T) {
2020
t.Parallel()
2121

2222
r.UnitTest(t, r.TestCase{
@@ -39,13 +39,13 @@ func TestImportBlock_InConfigDirectory_ConfigExactTrue(t *testing.T) {
3939
ImportState: true,
4040
ImportStateKind: r.ImportBlockWithID,
4141
ConfigDirectory: config.StaticDirectory(`testdata/2`),
42-
ConfigExact: true,
42+
ConfigExact: false,
4343
},
4444
},
4545
})
4646
}
4747

48-
func TestImportBlock_InConfigDirectory(t *testing.T) {
48+
func TestImportBlock_InConfigDirectory_ConfigExactTrue(t *testing.T) {
4949
t.Parallel()
5050

5151
r.UnitTest(t, r.TestCase{
@@ -67,8 +67,11 @@ func TestImportBlock_InConfigDirectory(t *testing.T) {
6767
ResourceName: "examplecloud_container.test",
6868
ImportState: true,
6969
ImportStateKind: r.ImportBlockWithID,
70-
ConfigDirectory: config.StaticDirectory(`testdata/writeable-config-directory`),
71-
ConfigExact: false,
70+
71+
// This content includes an import block with an ID so we will
72+
// use the exact content
73+
ConfigDirectory: config.StaticDirectory(`testdata/2_with_exact_import_config`),
74+
ConfigExact: true,
7275
},
7376
},
7477
})

helper/resource/importstate/import_block_in_config_file_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestImportBlock_InConfigFile(t *testing.T) {
3838
ResourceName: "examplecloud_container.test",
3939
ImportState: true,
4040
ImportStateKind: r.ImportBlockWithID,
41-
ConfigFile: config.StaticFile(`testdata/writeable-config-file/examplecloud_container.tf`),
41+
ConfigFile: config.StaticFile(`testdata/2/examplecloud_container.tf`),
4242
},
4343
},
4444
})
@@ -66,7 +66,7 @@ func TestImportBlock_WithResourceIdentity_InConfigFile(t *testing.T) {
6666
ResourceName: "examplecloud_container.test",
6767
ImportState: true,
6868
ImportStateKind: r.ImportBlockWithResourceIdentity,
69-
ConfigFile: config.StaticFile(`testdata/writeable-config-file/examplecloud_container.tf`),
69+
ConfigFile: config.StaticFile(`testdata/2/examplecloud_container.tf`),
7070
},
7171
},
7272
})

helper/resource/importstate/testdata/writeable-config-directory/examplecloud_container_import_with_identity.tf

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)