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:
Martin Atkins 2018-09-30 08:06:31 -07:00
parent dc0b5292a6
commit be7bce493e
1 changed files with 12 additions and 15 deletions

View File

@ -7,7 +7,9 @@ import (
"reflect"
"testing"
"github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/plugin/discovery"
"github.com/hashicorp/terraform/providers"
"github.com/hashicorp/terraform/terraform"
)
@ -20,16 +22,16 @@ func TestMultiVersionProviderResolver(t *testing.T) {
})
resolver := &multiVersionProviderResolver{
Internal: map[string]terraform.ResourceProviderFactory{
"internal": func() (terraform.ResourceProvider, error) {
return &terraform.MockResourceProvider{
ResourcesReturn: []terraform.ResourceType{
{
Name: "internal_foo",
Internal: map[string]providers.Factory{
"internal": providers.FactoryFixed(
&terraform.MockProvider{
GetSchemaReturn: &terraform.ProviderSchema{
ResourceTypes: map[string]*configschema.Block{
"internal_foo": {},
},
},
}, nil
},
),
},
Available: available,
}
@ -122,13 +124,8 @@ func TestInternalProviders(t *testing.T) {
t.Fatal(err)
}
dataSources := tfProvider.DataSources()
found := false
for _, ds := range dataSources {
if ds.Name == "terraform_remote_state" {
found = true
}
}
schema := tfProvider.GetSchema()
_, found := schema.DataSources["terraform_remote_state"]
if !found {
t.Errorf("didn't find terraform_remote_state in internal \"terraform\" provider")
}