mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-16 11:42:58 -06:00
core: Fix TestContext2Apply_dataDependsOn
The value returned from ReadDataSourceFn must conform to the schema for the data source.
This commit is contained in:
parent
fbe959ae6e
commit
ab1dc08e5c
@ -9181,24 +9181,20 @@ func TestContext2Apply_dataDependsOn(t *testing.T) {
|
|||||||
p.ReadDataSourceFn = func(req providers.ReadDataSourceRequest) providers.ReadDataSourceResponse {
|
p.ReadDataSourceFn = func(req providers.ReadDataSourceRequest) providers.ReadDataSourceResponse {
|
||||||
return providers.ReadDataSourceResponse{
|
return providers.ReadDataSourceResponse{
|
||||||
State: cty.ObjectVal(map[string]cty.Value{
|
State: cty.ObjectVal(map[string]cty.Value{
|
||||||
|
"id": cty.StringVal("boop"),
|
||||||
"foo": cty.StringVal(provisionerOutput),
|
"foo": cty.StringVal(provisionerOutput),
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_, diags := ctx.Refresh()
|
_, diags := ctx.Refresh()
|
||||||
if diags.HasErrors() {
|
assertNoErrors(t, diags)
|
||||||
t.Fatalf("diags: %s", diags.Err())
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, diags := ctx.Plan(); diags.HasErrors() {
|
_, diags = ctx.Plan()
|
||||||
t.Fatalf("plan errors: %s", diags.Err())
|
assertNoErrors(t, diags)
|
||||||
}
|
|
||||||
|
|
||||||
state, diags := ctx.Apply()
|
state, diags := ctx.Apply()
|
||||||
if diags.HasErrors() {
|
assertNoErrors(t, diags)
|
||||||
t.Fatalf("diags: %s", diags.Err())
|
|
||||||
}
|
|
||||||
|
|
||||||
root := state.Module(addrs.RootModuleInstance)
|
root := state.Module(addrs.RootModuleInstance)
|
||||||
var attrs map[string]interface{}
|
var attrs map[string]interface{}
|
||||||
|
Loading…
Reference in New Issue
Block a user