add test for planing unknown data source values

This commit is contained in:
James Bardin 2021-10-05 12:31:23 -04:00
parent 18d354223e
commit 58d85fcc2e
1 changed files with 48 additions and 0 deletions

View File

@ -1640,6 +1640,54 @@ func TestProposedNew(t *testing.T) {
}),
}),
},
// data sources are planned with an unknown value
"unknown prior nested objects": {
&configschema.Block{
Attributes: map[string]*configschema.Attribute{
"list": {
NestedType: &configschema.Object{
Nesting: configschema.NestingList,
Attributes: map[string]*configschema.Attribute{
"list": {
NestedType: &configschema.Object{
Nesting: configschema.NestingList,
Attributes: map[string]*configschema.Attribute{
"foo": {
Type: cty.String,
},
},
},
Computed: true,
},
},
},
Computed: true,
},
},
},
cty.UnknownVal(cty.Object(map[string]cty.Type{
"List": cty.List(cty.Object(map[string]cty.Type{
"list": cty.List(cty.Object(map[string]cty.Type{
"foo": cty.String,
})),
})),
})),
cty.NullVal(cty.Object(map[string]cty.Type{
"List": cty.List(cty.Object(map[string]cty.Type{
"list": cty.List(cty.Object(map[string]cty.Type{
"foo": cty.String,
})),
})),
})),
cty.UnknownVal(cty.Object(map[string]cty.Type{
"List": cty.List(cty.Object(map[string]cty.Type{
"list": cty.List(cty.Object(map[string]cty.Type{
"foo": cty.String,
})),
})),
})),
},
}
for name, test := range tests {