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,23 +189,19 @@ func TestContextImport_missingType(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestContextImport_moduleProvider(t *testing.T) {
|
||||
p := mockProviderWithResourceTypeSchema("aws_instance", &configschema.Block{})
|
||||
p.GetSchemaReturn.Provider = &configschema.Block{
|
||||
Attributes: map[string]*configschema.Attribute{
|
||||
"foo": {Type: cty.String, Optional: true},
|
||||
p := testProvider("aws")
|
||||
|
||||
p.GetSchemaReturn = &ProviderSchema{
|
||||
Provider: &configschema.Block{
|
||||
Attributes: map[string]*configschema.Attribute{
|
||||
"foo": {Type: cty.String, Optional: true},
|
||||
},
|
||||
},
|
||||
ResourceTypes: map[string]*configschema.Block{
|
||||
"aws_instance": {},
|
||||
},
|
||||
}
|
||||
|
||||
m := testModule(t, "import-provider")
|
||||
ctx := testContext2(t, &ContextOpts{
|
||||
Config: m,
|
||||
ProviderResolver: ResourceProviderResolverFixed(
|
||||
map[string]ResourceProviderFactory{
|
||||
"aws": testProviderFuncFixed(p),
|
||||
},
|
||||
),
|
||||
})
|
||||
|
||||
p.ImportStateReturn = []*InstanceState{
|
||||
&InstanceState{
|
||||
ID: "foo",
|
||||
|
@ -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