mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
add data responses where they were missing
A few test with had data sources that were never read before, and needed to get valid responses for the tests.
This commit is contained in:
parent
047c9b3cc6
commit
cf2dd43f30
@ -5504,11 +5504,18 @@ func TestContext2Plan_invalidOutput(t *testing.T) {
|
||||
data "aws_data_source" "name" {}
|
||||
|
||||
output "out" {
|
||||
value = "${data.aws_data_source.name.missing}"
|
||||
value = data.aws_data_source.name.missing
|
||||
}`,
|
||||
})
|
||||
|
||||
p := testProvider("aws")
|
||||
p.ReadDataSourceResponse = providers.ReadDataSourceResponse{
|
||||
State: cty.ObjectVal(map[string]cty.Value{
|
||||
"id": cty.StringVal("data_id"),
|
||||
"foo": cty.StringVal("foo"),
|
||||
}),
|
||||
}
|
||||
|
||||
ctx := testContext2(t, &ContextOpts{
|
||||
Config: m,
|
||||
Providers: map[addrs.Provider]providers.Factory{
|
||||
@ -5549,6 +5556,13 @@ resource "aws_instance" "foo" {
|
||||
})
|
||||
|
||||
p := testProvider("aws")
|
||||
p.ReadDataSourceResponse = providers.ReadDataSourceResponse{
|
||||
State: cty.ObjectVal(map[string]cty.Value{
|
||||
"id": cty.StringVal("data_id"),
|
||||
"foo": cty.StringVal("foo"),
|
||||
}),
|
||||
}
|
||||
|
||||
ctx := testContext2(t, &ContextOpts{
|
||||
Config: m,
|
||||
Providers: map[addrs.Provider]providers.Factory{
|
||||
|
@ -1612,6 +1612,11 @@ func TestContext2Refresh_dataResourceDependsOn(t *testing.T) {
|
||||
},
|
||||
}
|
||||
p.DiffFn = testDiffFn
|
||||
p.ReadDataSourceResponse = providers.ReadDataSourceResponse{
|
||||
State: cty.ObjectVal(map[string]cty.Value{
|
||||
"compute": cty.StringVal("value"),
|
||||
}),
|
||||
}
|
||||
|
||||
state := states.NewState()
|
||||
root := state.EnsureModule(addrs.RootModuleInstance)
|
||||
|
Loading…
Reference in New Issue
Block a user