core: Fix TestContext2Apply_dataBasic

The mock provider must be configured to return an object of a type that
conforms to the schema for the test_data_source resource type.
This commit is contained in:
Martin Atkins 2018-09-24 14:14:45 -07:00
parent 058df3563f
commit 6491c6d997
1 changed files with 2 additions and 3 deletions

View File

@ -1493,6 +1493,7 @@ func TestContext2Apply_dataBasic(t *testing.T) {
p.ReadDataSourceResponse = providers.ReadDataSourceResponse{ p.ReadDataSourceResponse = providers.ReadDataSourceResponse{
State: cty.ObjectVal(map[string]cty.Value{ State: cty.ObjectVal(map[string]cty.Value{
"id": cty.StringVal("yo"), "id": cty.StringVal("yo"),
"foo": cty.NullVal(cty.String),
}), }),
} }
@ -1512,9 +1513,7 @@ func TestContext2Apply_dataBasic(t *testing.T) {
} }
state, diags := ctx.Apply() state, diags := ctx.Apply()
if diags.HasErrors() { assertNoErrors(t, diags)
t.Fatalf("diags: %s", diags.Err())
}
actual := strings.TrimSpace(state.String()) actual := strings.TrimSpace(state.String())
expected := strings.TrimSpace(testTerraformApplyDataBasicStr) expected := strings.TrimSpace(testTerraformApplyDataBasicStr)