core: use testProvider for TestContextImport_moduleProvider
This test depends on the Refresh callback that comes built in to a provider returned from testProvider.
This commit is contained in:
parent
9c0335e22e
commit
fc8030d2ae
|
@ -189,22 +189,18 @@ func TestContextImport_missingType(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestContextImport_moduleProvider(t *testing.T) {
|
||||
p := mockProviderWithResourceTypeSchema("aws_instance", &configschema.Block{})
|
||||
p.GetSchemaReturn.Provider = &configschema.Block{
|
||||
p := testProvider("aws")
|
||||
|
||||
p.GetSchemaReturn = &ProviderSchema{
|
||||
Provider: &configschema.Block{
|
||||
Attributes: map[string]*configschema.Attribute{
|
||||
"foo": {Type: cty.String, Optional: true},
|
||||
},
|
||||
}
|
||||
|
||||
m := testModule(t, "import-provider")
|
||||
ctx := testContext2(t, &ContextOpts{
|
||||
Config: m,
|
||||
ProviderResolver: ResourceProviderResolverFixed(
|
||||
map[string]ResourceProviderFactory{
|
||||
"aws": testProviderFuncFixed(p),
|
||||
},
|
||||
),
|
||||
})
|
||||
ResourceTypes: map[string]*configschema.Block{
|
||||
"aws_instance": {},
|
||||
},
|
||||
}
|
||||
|
||||
p.ImportStateReturn = []*InstanceState{
|
||||
&InstanceState{
|
||||
|
@ -224,6 +220,16 @@ func TestContextImport_moduleProvider(t *testing.T) {
|
|||
return nil
|
||||
}
|
||||
|
||||
m := testModule(t, "import-provider")
|
||||
ctx := testContext2(t, &ContextOpts{
|
||||
Config: m,
|
||||
ProviderResolver: ResourceProviderResolverFixed(
|
||||
map[string]ResourceProviderFactory{
|
||||
"aws": testProviderFuncFixed(p),
|
||||
},
|
||||
),
|
||||
})
|
||||
|
||||
state, diags := ctx.Import(&ImportOpts{
|
||||
Config: m,
|
||||
Targets: []*ImportTarget{
|
||||
|
|
Loading…
Reference in New Issue