refresh is expected for destroy

These tests were not previously running a refresh, and hence did not
expect the resources to be read.
This commit is contained in:
James Bardin 2021-01-04 18:27:08 -05:00
parent 0b3b84acc1
commit e614fb9aed
2 changed files with 3 additions and 14 deletions

View File

@ -559,7 +559,7 @@ func TestLocal_planDestroy(t *testing.T) {
b, cleanup := TestLocal(t)
defer cleanup()
p := TestLocalProvider(t, b, "test", planFixtureSchema())
TestLocalProvider(t, b, "test", planFixtureSchema())
testStateFile(t, b.StatePath, testPlanState())
outDir := testTempDir(t)
@ -593,10 +593,6 @@ func TestLocal_planDestroy(t *testing.T) {
t.Fatalf("plan operation failed")
}
if p.ReadResourceCalled {
t.Fatal("ReadResource should not be called")
}
if run.PlanEmpty {
t.Fatal("plan should not be empty")
}
@ -613,7 +609,7 @@ func TestLocal_planDestroy_withDataSources(t *testing.T) {
b, cleanup := TestLocal(t)
defer cleanup()
p := TestLocalProvider(t, b, "test", planFixtureSchema())
TestLocalProvider(t, b, "test", planFixtureSchema())
testStateFile(t, b.StatePath, testPlanState_withDataSource())
b.CLI = cli.NewMockUi()
@ -649,14 +645,6 @@ func TestLocal_planDestroy_withDataSources(t *testing.T) {
t.Fatalf("plan operation failed")
}
if p.ReadResourceCalled {
t.Fatal("ReadResource should not be called")
}
if p.ReadDataSourceCalled {
t.Fatal("ReadDataSourceCalled should not be called")
}
if run.PlanEmpty {
t.Fatal("plan should not be empty")
}

View File

@ -1,4 +1,5 @@
resource "test_instance" "foo" {
count = 1
ami = "bar"
}