helper/schema: fix failing tests
This commit is contained in:
parent
6e29ea0366
commit
dbe83af829
|
@ -5,6 +5,8 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/config"
|
||||
"github.com/hashicorp/terraform/config/lang"
|
||||
"github.com/hashicorp/terraform/config/lang/ast"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
)
|
||||
|
||||
|
@ -1778,7 +1780,12 @@ func TestSchemaMap_Diff(t *testing.T) {
|
|||
}
|
||||
|
||||
if len(tc.ConfigVariables) > 0 {
|
||||
if err := c.Interpolate(tc.ConfigVariables); err != nil {
|
||||
vars := make(map[string]lang.Variable)
|
||||
for k, v := range tc.ConfigVariables {
|
||||
vars[k] = lang.Variable{Value: v, Type: ast.TypeString}
|
||||
}
|
||||
|
||||
if err := c.Interpolate(vars); err != nil {
|
||||
t.Fatalf("#%d err: %s", i, err)
|
||||
}
|
||||
}
|
||||
|
@ -2511,7 +2518,12 @@ func TestSchemaMap_Validate(t *testing.T) {
|
|||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
if tc.Vars != nil {
|
||||
if err := c.Interpolate(tc.Vars); err != nil {
|
||||
vars := make(map[string]lang.Variable)
|
||||
for k, v := range tc.Vars {
|
||||
vars[k] = lang.Variable{Value: v, Type: ast.TypeString}
|
||||
}
|
||||
|
||||
if err := c.Interpolate(vars); err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue