Skip to content

Commit

Permalink
add test for AtLeastOneOf
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Jan 7, 2020
1 parent 4518ddc commit f85f24c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions helper/schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6566,6 +6566,29 @@ func TestValidateAtLeastOneOfAttributes(t *testing.T) {
Err: false,
},

"only unknown list value": {
Schema: map[string]*Schema{
"whitelist": &Schema{
Type: TypeList,
Optional: true,
Elem: &Schema{Type: TypeString},
AtLeastOneOf: []string{"whitelist", "blacklist"},
},
"blacklist": &Schema{
Type: TypeList,
Optional: true,
Elem: &Schema{Type: TypeString},
AtLeastOneOf: []string{"whitelist", "blacklist"},
},
},

Config: map[string]interface{}{
"whitelist": []interface{}{hcl2shim.UnknownVariableValue},
},

Err: false,
},

"Unknown Variable Value and Known Value": {
Schema: map[string]*Schema{
"whitelist": &Schema{
Expand Down

0 comments on commit f85f24c

Please sign in to comment.