helper/schema: test setting computed value and retrieving it via state
This commit is contained in:
parent
4d067f4d6d
commit
22436555a7
|
@ -2258,6 +2258,37 @@ func TestResourceDataState(t *testing.T) {
|
|||
Attributes: map[string]string{},
|
||||
},
|
||||
},
|
||||
|
||||
// #22
|
||||
{
|
||||
Schema: map[string]*Schema{
|
||||
"foo": &Schema{
|
||||
Type: TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
|
||||
State: nil,
|
||||
|
||||
Diff: &terraform.InstanceDiff{
|
||||
Attributes: map[string]*terraform.ResourceAttrDiff{
|
||||
"foo": &terraform.ResourceAttrDiff{
|
||||
NewComputed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Set: map[string]interface{}{
|
||||
"foo": "bar",
|
||||
},
|
||||
|
||||
Result: &terraform.InstanceState{
|
||||
Attributes: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for i, tc := range cases {
|
||||
|
|
Loading…
Reference in New Issue