github.com/ibm-cloud/terraform@v0.6.4-0.20170726051544-8872b87621df/terraform/state_upgrade_v1_to_v2_test.go (about) 1 package terraform 2 3 import ( 4 "os" 5 "path/filepath" 6 "testing" 7 ) 8 9 func TestReadStateV1ToV2_noPath(t *testing.T) { 10 f, err := os.Open(filepath.Join(fixtureDir, "state-upgrade", "v1-to-v2-empty-path.tfstate")) 11 if err != nil { 12 t.Fatalf("err: %s", err) 13 } 14 defer f.Close() 15 16 s, err := ReadState(f) 17 if err != nil { 18 t.Fatalf("err: %s", err) 19 } 20 21 checkStateString(t, s, "<no state>") 22 }