mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
update mock provider call
This commit is contained in:
parent
027a6c2cf6
commit
103a6cf2db
@ -79,12 +79,13 @@ func TestLocal_refreshInput(t *testing.T) {
|
||||
p.ReadResourceResponse = providers.ReadResourceResponse{NewState: cty.ObjectVal(map[string]cty.Value{
|
||||
"id": cty.StringVal("yes"),
|
||||
})}
|
||||
p.ConfigureFn = func(c *terraform.ResourceConfig) error {
|
||||
if v, ok := c.Get("value"); !ok || v != "bar" {
|
||||
return fmt.Errorf("no value set")
|
||||
p.ConfigureFn = func(req providers.ConfigureRequest) (resp providers.ConfigureResponse) {
|
||||
val := req.Config.GetAttr("value")
|
||||
if val.IsNull() || val.AsString() != "bar" {
|
||||
resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("incorrect value %#v", val))
|
||||
}
|
||||
|
||||
return nil
|
||||
return
|
||||
}
|
||||
|
||||
// Enable input asking since it is normally disabled by default
|
||||
|
Loading…
Reference in New Issue
Block a user