github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/builtin/providers/cloudflare/provider_test.go (about)

     1  package cloudflare
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  
     7  	"github.com/hashicorp/terraform/helper/schema"
     8  	"github.com/hashicorp/terraform/terraform"
     9  )
    10  
    11  var testAccProviders map[string]terraform.ResourceProvider
    12  var testAccProvider *schema.Provider
    13  
    14  func init() {
    15  	testAccProvider = Provider().(*schema.Provider)
    16  	testAccProviders = map[string]terraform.ResourceProvider{
    17  		"cloudflare": testAccProvider,
    18  	}
    19  }
    20  
    21  func TestProvider(t *testing.T) {
    22  	if err := Provider().(*schema.Provider).InternalValidate(); err != nil {
    23  		t.Fatalf("err: %s", err)
    24  	}
    25  }
    26  
    27  func TestProvider_impl(t *testing.T) {
    28  	var _ terraform.ResourceProvider = Provider()
    29  }
    30  
    31  func testAccPreCheck(t *testing.T) {
    32  	if v := os.Getenv("CLOUDFLARE_EMAIL"); v == "" {
    33  		t.Fatal("CLOUDFLARE_EMAIL must be set for acceptance tests")
    34  	}
    35  
    36  	if v := os.Getenv("CLOUDFLARE_TOKEN"); v == "" {
    37  		t.Fatal("CLOUDFLARE_TOKEN must be set for acceptance tests")
    38  	}
    39  
    40  	if v := os.Getenv("CLOUDFLARE_DOMAIN"); v == "" {
    41  		t.Fatal("CLOUDFLARE_DOMAIN must be set for acceptance tests. The domain is used to ` and destroy record against.")
    42  	}
    43  }