package acmedns

import (
	"github.com/stretchr/testify/assert"
	"os"
	"testing"
)

var (
	acmednsLiveTest     bool
	acmednsHost         string
	acmednsAccountsJson []byte
	acmednsDomain       string
)

func init() {
	acmednsHost = os.Getenv("ACME_DNS_HOST")
	acmednsAccountsJson = []byte(os.Getenv("ACME_DNS_ACCOUNT_JSON"))
	if len(acmednsHost) > 0 && len(acmednsAccountsJson) > 0 {
		acmednsLiveTest = true
	}
}

func TestLiveAzureDnsPresent(t *testing.T) {
	if !acmednsLiveTest {
		t.Skip("skipping live test")
	}
	provider, err := NewDNSProviderHostBytes(acmednsHost, acmednsAccountsJson)
	assert.NoError(t, err)

	err = provider.Present(acmednsDomain, "", "123d==")
	assert.NoError(t, err)
}

package acmedns

import (
	"github.com/stretchr/testify/assert"
	"os"
	"testing"
)

var (
	acmednsLiveTest     bool
	acmednsHost         string
	acmednsAccountsJson []byte
	acmednsDomain       string
)

func init() {
	acmednsHost = os.Getenv("")
	acmednsAccountsJson = []byte(os.Getenv("AZURE_CLIENT_SECRET"))
	if len(acmednsHost) > 0 && len(acmednsAccountsJson) > 0 {
		acmednsLiveTest = true
	}
}

func TestLiveAzureDnsPresent(t *testing.T) {
	if !acmednsLiveTest {
		t.Skip("skipping live test")
	}
	provider, err := NewDNSProviderHostBytes(acmednsHost, acmednsAccountsJson)
	assert.NoError(t, err)

	err = provider.Present(acmednsDomain, "", "123d==")
	assert.NoError(t, err)
}

--- 
+++ 
@@ -14,8 +14,8 @@
 )
 
 func init() {
-	acmednsHost = os.Getenv("")
-	acmednsAccountsJson = []byte(os.Getenv("AZURE_CLIENT_SECRET"))
+	acmednsHost = os.Getenv("ACME_DNS_HOST")
+	acmednsAccountsJson = []byte(os.Getenv("ACME_DNS_ACCOUNT_JSON"))
 	if len(acmednsHost) > 0 && len(acmednsAccountsJson) > 0 {
 		acmednsLiveTest = true
 	}
Fix env variable names in unit test

Signed-off-by: Max Ehrlich <c7cd0513ef0c504f678ca33c2b168f4f84cd4d51@gmail.com>
