update test state strings for backend/local

This commit is contained in:
James Bardin 2017-11-07 21:23:08 -05:00
parent 3c807e5427
commit d62e9217ae
4 changed files with 10 additions and 1 deletions

View File

@ -53,6 +53,7 @@ func TestLocal_applyBasic(t *testing.T) {
checkState(t, b.StateOutPath, ` checkState(t, b.StateOutPath, `
test_instance.foo: test_instance.foo:
ID = yes ID = yes
provider = provider.test
`) `)
} }
@ -160,6 +161,7 @@ func TestLocal_applyError(t *testing.T) {
checkState(t, b.StateOutPath, ` checkState(t, b.StateOutPath, `
test_instance.foo: test_instance.foo:
ID = foo ID = foo
provider = provider.test
`) `)
} }
@ -211,6 +213,7 @@ func TestLocal_applyBackendFail(t *testing.T) {
checkState(t, "errored.tfstate", ` checkState(t, "errored.tfstate", `
test_instance.foo: test_instance.foo:
ID = yes ID = yes
provider = provider.test
`) `)
} }

View File

@ -220,7 +220,7 @@ func TestLocal_planDestroyNoConfig(t *testing.T) {
} }
<-run.Done() <-run.Done()
if run.Err != nil { if run.Err != nil {
t.Fatalf("err: %s", err) t.Fatalf("err: %s", run.Err)
} }
if !p.RefreshCalled { if !p.RefreshCalled {

View File

@ -37,6 +37,7 @@ func TestLocal_refresh(t *testing.T) {
checkState(t, b.StateOutPath, ` checkState(t, b.StateOutPath, `
test_instance.foo: test_instance.foo:
ID = yes ID = yes
provider = provider.test
`) `)
} }
@ -64,6 +65,7 @@ func TestLocal_refreshNilModule(t *testing.T) {
checkState(t, b.StateOutPath, ` checkState(t, b.StateOutPath, `
test_instance.foo: test_instance.foo:
ID = yes ID = yes
provider = provider.test
`) `)
} }
@ -94,6 +96,7 @@ func TestLocal_refreshNilModuleWithInput(t *testing.T) {
checkState(t, b.StateOutPath, ` checkState(t, b.StateOutPath, `
test_instance.foo: test_instance.foo:
ID = yes ID = yes
provider = provider.test
`) `)
} }
@ -137,6 +140,7 @@ func TestLocal_refreshInput(t *testing.T) {
checkState(t, b.StateOutPath, ` checkState(t, b.StateOutPath, `
test_instance.foo: test_instance.foo:
ID = yes ID = yes
provider = provider.test
`) `)
} }
@ -170,6 +174,7 @@ func TestLocal_refreshValidate(t *testing.T) {
checkState(t, b.StateOutPath, ` checkState(t, b.StateOutPath, `
test_instance.foo: test_instance.foo:
ID = yes ID = yes
provider = provider.test
`) `)
} }

View File

@ -27,6 +27,7 @@ func TestLocal_backend(t *testing.T) {
} }
func checkState(t *testing.T, path, expected string) { func checkState(t *testing.T, path, expected string) {
t.Helper()
// Read the state // Read the state
f, err := os.Open(path) f, err := os.Open(path)
if err != nil { if err != nil {