github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/state/remote/consul_test.go (about)

     1  package remote
     2  
     3  import (
     4  	"fmt"
     5  	"net/http"
     6  	"testing"
     7  	"time"
     8  )
     9  
    10  func TestConsulClient_impl(t *testing.T) {
    11  	var _ Client = new(ConsulClient)
    12  }
    13  
    14  func TestConsulClient(t *testing.T) {
    15  	if _, err := http.Get("http://google.com"); err != nil {
    16  		t.Skipf("skipping, internet seems to not be available: %s", err)
    17  	}
    18  
    19  	client, err := consulFactory(map[string]string{
    20  		"address": "demo.consul.io:80",
    21  		"path":    fmt.Sprintf("tf-unit/%s", time.Now().String()),
    22  	})
    23  	if err != nil {
    24  		t.Fatalf("bad: %s", err)
    25  	}
    26  
    27  	testClient(t, client)
    28  }