From e7cfbb973778e11e855d1524d1638bc1c982a0a6 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 24 May 2018 18:31:45 -0700 Subject: [PATCH] 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. --- terraform/context_input_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/terraform/context_input_test.go b/terraform/context_input_test.go index 54f3f6b12..549503716 100644 --- a/terraform/context_input_test.go +++ b/terraform/context_input_test.go @@ -8,6 +8,8 @@ import ( "testing" "github.com/zclconf/go-cty/cty" + + "github.com/hashicorp/terraform/config/configschema" ) func TestContext2Input(t *testing.T) { @@ -682,6 +684,16 @@ func TestContext2Input_hcl(t *testing.T) { p := testProvider("hcl") p.ApplyFn = testApplyFn 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{ Config: m, ProviderResolver: ResourceProviderResolverFixed(