Skip to content

Commit a3d86f4

Browse files
committed
Added write-only tests to respective test files
1 parent 6611fc1 commit a3d86f4

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

internal/schemamd/write_attribute_description_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ func TestWriteAttributeDescription(t *testing.T) {
3030
Description: "This is an attribute.",
3131
},
3232
},
33+
{
34+
"(String, Required, Write-only) This is an attribute.",
35+
&tfjson.SchemaAttribute{
36+
AttributeType: cty.String,
37+
Required: true,
38+
Description: "This is an attribute.",
39+
WriteOnly: true,
40+
},
41+
},
3342
{
3443
"(String, Required, Deprecated) This is an attribute.",
3544
&tfjson.SchemaAttribute{

internal/schemamd/write_nested_attribute_type_description_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@ func TestWriteNestedAttributeTypeDescription(t *testing.T) {
3838
Optional: true,
3939
},
4040
},
41+
{
42+
"(Attributes, Optional, Write-only) This is an attribute.",
43+
&tfjson.SchemaAttribute{
44+
Description: "This is an attribute.",
45+
AttributeNestedType: &tfjson.SchemaNestedAttributeType{
46+
NestingMode: tfjson.SchemaNestingModeSingle,
47+
Attributes: map[string]*tfjson.SchemaAttribute{
48+
"foo": {
49+
AttributeType: cty.String,
50+
Required: true,
51+
Description: "This is a nested attribute.",
52+
},
53+
},
54+
},
55+
Optional: true,
56+
WriteOnly: true,
57+
},
58+
},
4159
{
4260
"(Attributes List, Min: 2, Max: 3) This is an attribute.",
4361
&tfjson.SchemaAttribute{

0 commit comments

Comments
 (0)