github.com/hobbeswalsh/terraform@v0.3.7-0.20150619183303-ad17cf55a0fa/state/remote/atlas_test.go (about)

     1  package remote
     2  
     3  import (
     4  	"net/http"
     5  	"os"
     6  	"testing"
     7  )
     8  
     9  func TestAtlasClient_impl(t *testing.T) {
    10  	var _ Client = new(AtlasClient)
    11  }
    12  
    13  func TestAtlasClient(t *testing.T) {
    14  	if _, err := http.Get("http://google.com"); err != nil {
    15  		t.Skipf("skipping, internet seems to not be available: %s", err)
    16  	}
    17  
    18  	token := os.Getenv("ATLAS_TOKEN")
    19  	if token == "" {
    20  		t.Skipf("skipping, ATLAS_TOKEN must be set")
    21  	}
    22  
    23  	client, err := atlasFactory(map[string]string{
    24  		"access_token": token,
    25  		"name":         "hashicorp/test-remote-state",
    26  	})
    27  	if err != nil {
    28  		t.Fatalf("bad: %s", err)
    29  	}
    30  
    31  	testClient(t, client)
    32  }