mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
3f6ce3c588
* terraform: add helper functions for creating test state testSetResourceInstanceCurrent and testSetResourceInstanceTainted are wrapper functions around states.Module.SetResourceInstanceCurrent() used to set a resource in state. They work with current, non-deposed resources with no dependencies. testSetResourceInstanceDeposed can be used to set a desosed resource in state. * terraform: update all tests to use modern providers and state
20 lines
483 B
Go
20 lines
483 B
Go
package terraform
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/addrs"
|
|
"github.com/hashicorp/terraform/configs/configschema"
|
|
)
|
|
|
|
func simpleTestSchemas() *Schemas {
|
|
provider := simpleMockProvider()
|
|
provisioner := simpleMockProvisioner()
|
|
return &Schemas{
|
|
Providers: map[addrs.Provider]*ProviderSchema{
|
|
addrs.NewDefaultProvider("test"): provider.GetSchemaReturn,
|
|
},
|
|
Provisioners: map[string]*configschema.Block{
|
|
"test": provisioner.GetSchemaResponse.Provisioner,
|
|
},
|
|
}
|
|
}
|