github.com/paybyphone/terraform@v0.9.5-0.20170613192930-9706042ddd51/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  }