provider/aws: add test for provider aliases
Not sure if this test has value /cc @mitchellh (who requested one be added) to see what I might be missing here. refs #2495
This commit is contained in:
parent
2d6a8c1f39
commit
00a177cd99
|
@ -4423,6 +4423,37 @@ func TestContext2Apply_moduleProviderAlias(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestContext2Apply_moduleProviderAliasTargets(t *testing.T) {
|
||||||
|
m := testModule(t, "apply-module-provider-alias")
|
||||||
|
p := testProvider("aws")
|
||||||
|
p.ApplyFn = testApplyFn
|
||||||
|
p.DiffFn = testDiffFn
|
||||||
|
ctx := testContext2(t, &ContextOpts{
|
||||||
|
Module: m,
|
||||||
|
Providers: map[string]ResourceProviderFactory{
|
||||||
|
"aws": testProviderFuncFixed(p),
|
||||||
|
},
|
||||||
|
Targets: []string{"no.thing"},
|
||||||
|
})
|
||||||
|
|
||||||
|
if _, err := ctx.Plan(); err != nil {
|
||||||
|
t.Fatalf("err: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
state, err := ctx.Apply()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("err: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
actual := strings.TrimSpace(state.String())
|
||||||
|
expected := strings.TrimSpace(`
|
||||||
|
<no state>
|
||||||
|
`)
|
||||||
|
if actual != expected {
|
||||||
|
t.Fatalf("bad: \n%s", actual)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestContext2Apply_moduleVarResourceCount(t *testing.T) {
|
func TestContext2Apply_moduleVarResourceCount(t *testing.T) {
|
||||||
m := testModule(t, "apply-module-var-resource-count")
|
m := testModule(t, "apply-module-var-resource-count")
|
||||||
p := testProvider("aws")
|
p := testProvider("aws")
|
||||||
|
|
Loading…
Reference in New Issue