github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/builtin/providers/bitbucket/provider_test.go (about)

     1  package bitbucket
     2  
     3  import (
     4  	"github.com/hashicorp/terraform/helper/schema"
     5  	"github.com/hashicorp/terraform/terraform"
     6  	"os"
     7  	"testing"
     8  )
     9  
    10  const testRepo string = "test-repo"
    11  
    12  var testAccProviders map[string]terraform.ResourceProvider
    13  var testAccProvider *schema.Provider
    14  
    15  func init() {
    16  	testAccProvider = Provider().(*schema.Provider)
    17  	testAccProviders = map[string]terraform.ResourceProvider{
    18  		"bitbucket": testAccProvider,
    19  	}
    20  }
    21  
    22  func TestProvider(t *testing.T) {
    23  	if err := Provider().(*schema.Provider).InternalValidate(); err != nil {
    24  		t.Fatalf("err: %s", err)
    25  	}
    26  }
    27  
    28  func TestProvider_impl(t *testing.T) {
    29  	var _ terraform.ResourceProvider = Provider()
    30  }
    31  
    32  func testAccPreCheck(t *testing.T) {
    33  	if v := os.Getenv("BITBUCKET_USERNAME"); v == "" {
    34  		t.Fatal("BITBUCKET_USERNAME must be set for acceptence tests")
    35  	}
    36  	if v := os.Getenv("BITBUCKET_PASSWORD"); v == "" {
    37  		t.Fatal("BITBUCKET_PASSWORD must be set for acceptence tests")
    38  	}
    39  }