@@ -35,10 +35,40 @@ func TestImportBlock_InConfigDirectory(t *testing.T) {
3535 ConfigDirectory : config .StaticDirectory (`testdata/1` ),
3636 },
3737 {
38- ResourceName : "examplecloud_container.test" ,
39- ImportState : true ,
40- ImportStateKind : r .ImportBlockWithID ,
41- ConfigDirectory : config .StaticDirectory (`testdata/2` ),
38+ ResourceName : "examplecloud_container.test" ,
39+ ImportState : true ,
40+ ImportStateKind : r .ImportBlockWithID ,
41+ ImportStateReadOnlyConfig : true , // TODO: naming
42+ ConfigDirectory : config .StaticDirectory (`testdata/2` ),
43+ },
44+ },
45+ })
46+ }
47+
48+ func TestImportBlock_InConfigDirectory_Writeable (t * testing.T ) {
49+ t .Parallel ()
50+
51+ r .UnitTest (t , r.TestCase {
52+ TerraformVersionChecks : []tfversion.TerraformVersionCheck {
53+ tfversion .SkipBelow (tfversion .Version1_5_0 ), // ImportBlockWithID requires Terraform 1.5.0 or later
54+ },
55+ ProtoV6ProviderFactories : map [string ]func () (tfprotov6.ProviderServer , error ){
56+ "examplecloud" : providerserver .NewProviderServer (testprovider.Provider {
57+ Resources : map [string ]testprovider.Resource {
58+ "examplecloud_container" : examplecloudResource (),
59+ },
60+ }),
61+ },
62+ Steps : []r.TestStep {
63+ {
64+ ConfigDirectory : config .StaticDirectory (`testdata/1` ),
65+ },
66+ {
67+ ResourceName : "examplecloud_container.test" ,
68+ ImportState : true ,
69+ ImportStateKind : r .ImportBlockWithID ,
70+ ImportStateReadOnlyConfig : false ,
71+ ConfigDirectory : config .StaticDirectory (`testdata/helper/writeable-config-directory` ),
4272 },
4373 },
4474 })
0 commit comments