-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprovider_test.go
More file actions
49 lines (40 loc) · 865 Bytes
/
provider_test.go
File metadata and controls
49 lines (40 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Integration tests for the do.de provider
package dode
import (
"context"
"fmt"
"os"
"testing"
"github.com/libdns/libdns"
)
var (
apiToken = ""
zone = ""
testRecords = []libdns.Record{
libdns.RR{
Type: "TXT",
Name: "_acme-challenge.test",
Data: "foo",
},
}
)
func TestMain(m *testing.M) {
fmt.Println("Loading environment variables to set up provider")
apiToken = os.Getenv("LIBDNS_DODE_API_TOKEN")
zone = os.Getenv("LIBDNS_DODE_ZONE")
os.Exit(m.Run())
}
func TestProvider_AppendDeleteRecords(t *testing.T) {
p := &Provider{
APIToken: apiToken,
}
_, err := p.AppendRecords(context.TODO(), zone, testRecords)
if err != nil {
t.Fatalf("appending record failed: %v", err)
return
}
_, err = p.DeleteRecords(context.TODO(), zone, testRecords)
if err != nil {
t.Fatalf("deleting record failed: %v", err)
}
}