terraform: more tests
This commit is contained in:
parent
ef32656a65
commit
f85baf6e26
|
@ -1226,25 +1226,6 @@ func TestContext2Plan_taint(t *testing.T) {
|
|||
}
|
||||
|
||||
/*
|
||||
// Doing a Refresh (or any operation really, but Refresh usually
|
||||
// happens first) with a config with an unknown provider should result in
|
||||
// an error. The key bug this found was that this wasn't happening if
|
||||
// Providers was _empty_.
|
||||
func TestContextRefresh_unknownProvider(t *testing.T) {
|
||||
m := testModule(t, "refresh-unknown-provider")
|
||||
p := testProvider("aws")
|
||||
p.ApplyFn = testApplyFn
|
||||
p.DiffFn = testDiffFn
|
||||
ctx := testContext(t, &ContextOpts{
|
||||
Module: m,
|
||||
Providers: map[string]ResourceProviderFactory{},
|
||||
})
|
||||
|
||||
if _, err := ctx.Refresh(); err == nil {
|
||||
t.Fatal("should error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestContextPlan_multiple_taint(t *testing.T) {
|
||||
m := testModule(t, "plan-taint")
|
||||
p := testProvider("aws")
|
||||
|
@ -1772,6 +1753,25 @@ func TestContext2Refresh_tainted(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// Doing a Refresh (or any operation really, but Refresh usually
|
||||
// happens first) with a config with an unknown provider should result in
|
||||
// an error. The key bug this found was that this wasn't happening if
|
||||
// Providers was _empty_.
|
||||
func TestContext2Refresh_unknownProvider(t *testing.T) {
|
||||
m := testModule(t, "refresh-unknown-provider")
|
||||
p := testProvider("aws")
|
||||
p.ApplyFn = testApplyFn
|
||||
p.DiffFn = testDiffFn
|
||||
ctx := testContext2(t, &ContextOpts{
|
||||
Module: m,
|
||||
Providers: map[string]ResourceProviderFactory{},
|
||||
})
|
||||
|
||||
if _, err := ctx.Refresh(); err == nil {
|
||||
t.Fatal("should error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestContext2Refresh_vars(t *testing.T) {
|
||||
p := testProvider("aws")
|
||||
m := testModule(t, "refresh-vars")
|
||||
|
|
Loading…
Reference in New Issue