Add more specific exists tests

This commit is contained in:
Jake Champlin 2017-08-03 14:14:39 -04:00
parent 268138dbd4
commit fa272e8c9c
No known key found for this signature in database
GPG Key ID: DC31F41958EF4AC2
1 changed files with 45 additions and 0 deletions

View File

@ -1258,6 +1258,51 @@ func TestResourceDataGetOkExists(t *testing.T) {
Value: 0, Value: 0,
Ok: false, Ok: false,
}, },
{
Name: "bool-literal-empty",
Schema: map[string]*Schema{
"availability_zone": {
Type: TypeBool,
Optional: true,
Computed: true,
ForceNew: true,
},
},
State: nil,
Diff: nil,
Key: "availability_zone",
Value: false,
Ok: false,
},
{
Name: "bool-literal-set",
Schema: map[string]*Schema{
"availability_zone": {
Type: TypeBool,
Optional: true,
Computed: true,
ForceNew: true,
},
},
State: nil,
Diff: &terraform.InstanceDiff{
Attributes: map[string]*terraform.ResourceAttrDiff{
"availability_zone": {
New: "true",
},
},
},
Key: "availability_zone",
Value: true,
Ok: true,
},
} }
for _, tc := range cases { for _, tc := range cases {