INNER CODE UNIT · Go
TestDataSource_CurrentDir
hashicorp/terraform-provider-external · internal/provider/data_source_test.go:254
func TestDataSource_CurrentDir(t *testing.T) {
programPath, err := buildDataSourceTestProgram()
if err != nil {
t.Fatal(err)
return
}
wd, err := os.Getwd()
if err != nil {
t.Fatalf("cannot create get current working dir: %s", err)
}
tempDir := t.TempDir()
err = os.Rename(programPath, filepath.Join(tempDir, "tf-acc-external-data-source"))
if err != nil {
t.Fatalf("cannot move tf-acc-external-data-source from go bin to temp dir: %s", err)
}