add Provider schema to the contextFixture

This commit is contained in:
James Bardin 2018-05-24 15:53:34 -04:00 committed by Martin Atkins
parent 672221e38e
commit edacd9ff4d
1 changed files with 17 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"testing" "testing"
"github.com/hashicorp/terraform/config/configschema" "github.com/hashicorp/terraform/config/configschema"
"github.com/zclconf/go-cty/cty"
) )
func TestMockResourceProvider_impl(t *testing.T) { func TestMockResourceProvider_impl(t *testing.T) {
@ -36,6 +37,22 @@ func mockProviderWithConfigSchema(schema *configschema.Block) *MockResourceProvi
func mockProviderWithResourceTypeSchema(name string, schema *configschema.Block) *MockResourceProvider { func mockProviderWithResourceTypeSchema(name string, schema *configschema.Block) *MockResourceProvider {
return &MockResourceProvider{ return &MockResourceProvider{
GetSchemaReturn: &ProviderSchema{ GetSchemaReturn: &ProviderSchema{
Provider: &configschema.Block{
Attributes: map[string]*configschema.Attribute{
"string": {
Type: cty.String,
Optional: true,
},
"list": {
Type: cty.List(cty.String),
Optional: true,
},
"root": {
Type: cty.Map(cty.String),
Optional: true,
},
},
},
ResourceTypes: map[string]*configschema.Block{ ResourceTypes: map[string]*configschema.Block{
name: schema, name: schema,
}, },