mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-27 09:21:14 -06:00
command: Update plugins_test.go for new provider types
This only makes it compile. It does not yet ensure that the tests pass.
This commit is contained in:
parent
dc0b5292a6
commit
be7bce493e
@ -7,7 +7,9 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform/configs/configschema"
|
||||||
"github.com/hashicorp/terraform/plugin/discovery"
|
"github.com/hashicorp/terraform/plugin/discovery"
|
||||||
|
"github.com/hashicorp/terraform/providers"
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/terraform"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -20,16 +22,16 @@ func TestMultiVersionProviderResolver(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
resolver := &multiVersionProviderResolver{
|
resolver := &multiVersionProviderResolver{
|
||||||
Internal: map[string]terraform.ResourceProviderFactory{
|
Internal: map[string]providers.Factory{
|
||||||
"internal": func() (terraform.ResourceProvider, error) {
|
"internal": providers.FactoryFixed(
|
||||||
return &terraform.MockResourceProvider{
|
&terraform.MockProvider{
|
||||||
ResourcesReturn: []terraform.ResourceType{
|
GetSchemaReturn: &terraform.ProviderSchema{
|
||||||
{
|
ResourceTypes: map[string]*configschema.Block{
|
||||||
Name: "internal_foo",
|
"internal_foo": {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, nil
|
},
|
||||||
},
|
),
|
||||||
},
|
},
|
||||||
Available: available,
|
Available: available,
|
||||||
}
|
}
|
||||||
@ -122,13 +124,8 @@ func TestInternalProviders(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dataSources := tfProvider.DataSources()
|
schema := tfProvider.GetSchema()
|
||||||
found := false
|
_, found := schema.DataSources["terraform_remote_state"]
|
||||||
for _, ds := range dataSources {
|
|
||||||
if ds.Name == "terraform_remote_state" {
|
|
||||||
found = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !found {
|
if !found {
|
||||||
t.Errorf("didn't find terraform_remote_state in internal \"terraform\" provider")
|
t.Errorf("didn't find terraform_remote_state in internal \"terraform\" provider")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user