<commit_before>package acme

import (
	"os"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

var (
	dnsimpleLiveTest bool
	dnsimpleEmail    string
	dnsimpleAPIKey   string
	dnsimpleDomain   string
)

func init() {
	dnsimpleEmail = os.Getenv("DNSIMPLE_EMAIL")
	dnsimpleAPIKey = os.Getenv("DNSIMPLE_API_KEY")
	dnsimpleDomain = os.Getenv("DNSIMPLE_DOMAIN")
	if len(dnsimpleEmail) > 0 && len(dnsimpleAPIKey) > 0 && len(dnsimpleDomain) > 0 {
		dnsimpleLiveTest = true
	}
}

func restoreDNSimpleEnv() {
	os.Setenv("DNSIMPLE_EMAIL", dnsimpleEmail)
	os.Setenv("DNSIMPLE_API_KEY", dnsimpleAPIKey)
}

func TestNewDNSProviderDNSimpleValid(t *testing.T) {
	os.Setenv("DNSIMPLE_EMAIL", "")
	os.Setenv("DNSIMPLE_API_KEY", "")
	_, err := NewDNSProviderDNSimple("<EMAIL>", "123")
	assert.NoError(t, err)
	restoreDNSimpleEnv()
}
func TestNewDNSProviderDNSimpleValidEnv(t *testing.T) {
	os.Setenv("DNSIMPLE_EMAIL", "<EMAIL>")
	os.Setenv("DNSIMPLE_API_KEY", "123")
	_, err := NewDNSProviderDNSimple("", "")
	assert.NoError(t, err)
	restoreDNSimpleEnv()
}

func TestNewDNSProviderDNSimpleMissingCredErr(t *testing.T) {
	os.Setenv("DNSIMPLE_EMAIL", "")
	os.Setenv("DNSIMPLE_API_KEY", "")
	_, err := NewDNSProviderDNSimple("", "")
	assert.EqualError(t, err, "DNSimple credentials missing")
	restoreDNSimpleEnv()
}

func TestLiveDNSimplePresent(t *testing.T) {
	if !dnsimpleLiveTest {
		t.Skip("skipping live test")
	}

	provider, err := NewDNSProviderDNSimple(dnsimpleEmail, dnsimpleAPIKey)
	assert.NoError(t, err)

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

func TestLiveDNSimpleCleanUp(t *testing.T) {
	if !dnsimpleLiveTest {
		t.Skip("skipping live test")
	}

	time.Sleep(time.Second * 1)

	provider, err := NewDNSProviderDNSimple(cflareEmail, cflareAPIKey)
	assert.NoError(t, err)

	err = provider.CleanUp(dnsimpleDomain, "", "123d==")
	assert.NoError(t, err)
}<commit_msg>Fix wrong variables being used in DNSimple test.<commit_after>package acme

import (
	"os"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

var (
	dnsimpleLiveTest bool
	dnsimpleEmail    string
	dnsimpleAPIKey   string
	dnsimpleDomain   string
)

func init() {
	dnsimpleEmail = os.Getenv("DNSIMPLE_EMAIL")
	dnsimpleAPIKey = os.Getenv("DNSIMPLE_API_KEY")
	dnsimpleDomain = os.Getenv("DNSIMPLE_DOMAIN")
	if len(dnsimpleEmail) > 0 && len(dnsimpleAPIKey) > 0 && len(dnsimpleDomain) > 0 {
		dnsimpleLiveTest = true
	}
}

func restoreDNSimpleEnv() {
	os.Setenv("DNSIMPLE_EMAIL", dnsimpleEmail)
	os.Setenv("DNSIMPLE_API_KEY", dnsimpleAPIKey)
}

func TestNewDNSProviderDNSimpleValid(t *testing.T) {
	os.Setenv("DNSIMPLE_EMAIL", "")
	os.Setenv("DNSIMPLE_API_KEY", "")
	_, err := NewDNSProviderDNSimple("<EMAIL>", "123")
	assert.NoError(t, err)
	restoreDNSimpleEnv()
}
func TestNewDNSProviderDNSimpleValidEnv(t *testing.T) {
	os.Setenv("DNSIMPLE_EMAIL", "<EMAIL>")
	os.Setenv("DNSIMPLE_API_KEY", "123")
	_, err := NewDNSProviderDNSimple("", "")
	assert.NoError(t, err)
	restoreDNSimpleEnv()
}

func TestNewDNSProviderDNSimpleMissingCredErr(t *testing.T) {
	os.Setenv("DNSIMPLE_EMAIL", "")
	os.Setenv("DNSIMPLE_API_KEY", "")
	_, err := NewDNSProviderDNSimple("", "")
	assert.EqualError(t, err, "DNSimple credentials missing")
	restoreDNSimpleEnv()
}

func TestLiveDNSimplePresent(t *testing.T) {
	if !dnsimpleLiveTest {
		t.Skip("skipping live test")
	}

	provider, err := NewDNSProviderDNSimple(dnsimpleEmail, dnsimpleAPIKey)
	assert.NoError(t, err)

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

func TestLiveDNSimpleCleanUp(t *testing.T) {
	if !dnsimpleLiveTest {
		t.Skip("skipping live test")
	}

	time.Sleep(time.Second * 1)

	provider, err := NewDNSProviderDNSimple(dnsimpleEmail, dnsimpleAPIKey)
	assert.NoError(t, err)

	err = provider.CleanUp(dnsimpleDomain, "", "123d==")
	assert.NoError(t, err)
}
{'fraction_non_alphanumeric': 0.1452325279293323, 'fraction_numerical': 0.00831384775266303, 'mean_word_length': 6.038391224862888, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '802142', 'n_tokens_mistral': 1671, 'n_tokens_neox': 1525, 'n_words': 237}