github.com/graywolf-at-work-2/terraform-vendor@v1.4.5/internal/command/e2etest/module_archive_test.go (about) 1 package e2etest 2 3 import ( 4 "path/filepath" 5 "strings" 6 "testing" 7 8 "github.com/hashicorp/terraform/internal/e2e" 9 ) 10 11 func TestInitModuleArchive(t *testing.T) { 12 t.Parallel() 13 14 // this fetches a module archive from github 15 skipIfCannotAccessNetwork(t) 16 17 fixturePath := filepath.Join("testdata", "module-archive") 18 tf := e2e.NewBinary(t, terraformBin, fixturePath) 19 20 stdout, stderr, err := tf.Run("init") 21 if err != nil { 22 t.Errorf("unexpected error: %s", err) 23 } 24 25 if stderr != "" { 26 t.Errorf("unexpected stderr output:\n%s", stderr) 27 } 28 29 if !strings.Contains(stdout, "Terraform has been successfully initialized!") { 30 t.Errorf("success message is missing from output:\n%s", stdout) 31 } 32 }