2016-03-08 23:05:22 +01:00
|
|
|
package github
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/helper/schema"
|
|
|
|
"github.com/hashicorp/terraform/terraform"
|
|
|
|
)
|
|
|
|
|
2016-06-02 02:06:35 +02:00
|
|
|
const testRepo string = "test-repo"
|
|
|
|
|
2016-03-08 23:05:22 +01:00
|
|
|
var testAccProviders map[string]terraform.ResourceProvider
|
|
|
|
var testAccProvider *schema.Provider
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
testAccProvider = Provider().(*schema.Provider)
|
|
|
|
testAccProviders = map[string]terraform.ResourceProvider{
|
|
|
|
"github": testAccProvider,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestProvider(t *testing.T) {
|
|
|
|
if err := Provider().(*schema.Provider).InternalValidate(); err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestProvider_impl(t *testing.T) {
|
|
|
|
var _ terraform.ResourceProvider = Provider()
|
|
|
|
}
|
|
|
|
|
|
|
|
func testAccPreCheck(t *testing.T) {
|
|
|
|
if v := os.Getenv("GITHUB_TOKEN"); v == "" {
|
|
|
|
t.Fatal("GITHUB_TOKEN must be set for acceptance tests")
|
|
|
|
}
|
|
|
|
if v := os.Getenv("GITHUB_ORGANIZATION"); v == "" {
|
|
|
|
t.Fatal("GITHUB_ORGANIZATION must be set for acceptance tests")
|
|
|
|
}
|
2016-03-19 03:55:33 +01:00
|
|
|
if v := os.Getenv("GITHUB_TEST_USER"); v == "" {
|
|
|
|
t.Fatal("GITHUB_TEST_USER must be set for acceptance tests")
|
|
|
|
}
|
2016-06-02 02:06:35 +02:00
|
|
|
if v := os.Getenv("GITHUB_TEST_COLLABORATOR"); v == "" {
|
|
|
|
t.Fatal("GITHUB_TEST_COLLABORATOR must be set for acceptance tests")
|
|
|
|
}
|
2016-03-08 23:05:22 +01:00
|
|
|
}
|