core: Fix TestContext2Input_hcl

This test now needs to provide a mock schema for its resource type so that
the two test arguments can be assigned.
This commit is contained in:
Martin Atkins 2018-05-24 18:31:45 -07:00
parent b6fe705985
commit e7cfbb9737
1 changed files with 12 additions and 0 deletions

View File

@ -8,6 +8,8 @@ import (
"testing" "testing"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/config/configschema"
) )
func TestContext2Input(t *testing.T) { func TestContext2Input(t *testing.T) {
@ -682,6 +684,16 @@ func TestContext2Input_hcl(t *testing.T) {
p := testProvider("hcl") p := testProvider("hcl")
p.ApplyFn = testApplyFn p.ApplyFn = testApplyFn
p.DiffFn = testDiffFn p.DiffFn = testDiffFn
p.GetSchemaReturn = &ProviderSchema{
ResourceTypes: map[string]*configschema.Block{
"hcl_instance": {
Attributes: map[string]*configschema.Attribute{
"foo": {Type: cty.List(cty.String), Optional: true},
"bar": {Type: cty.Map(cty.String), Optional: true},
},
},
},
}
ctx := testContext2(t, &ContextOpts{ ctx := testContext2(t, &ContextOpts{
Config: m, Config: m,
ProviderResolver: ResourceProviderResolverFixed( ProviderResolver: ResourceProviderResolverFixed(