mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Linting (#1087)
* fix linting * rename AuditRecordsor to RecordAuditor * gandi_v5 to gandiv5
This commit is contained in:
44
providers/gandiv5/convert_test.go
Normal file
44
providers/gandiv5/convert_test.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package gandiv5
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/StackExchange/dnscontrol/v3/models"
|
||||
)
|
||||
|
||||
func TestRecordsToNative_1(t *testing.T) {
|
||||
var rcs = []*models.RecordConfig{{}}
|
||||
rcs[0].SetLabelFromFQDN("foo.example.com", "example.com")
|
||||
rcs[0].Type = "A"
|
||||
rcs[0].SetTarget("1.2.3.4")
|
||||
|
||||
ns := recordsToNative(rcs, "example.com")
|
||||
|
||||
if len(ns) != 1 {
|
||||
t.Errorf("len(ns) != 1; got=%v", len(ns))
|
||||
}
|
||||
if len(ns[0].RrsetValues) != 1 {
|
||||
t.Errorf("len(ns[0].RrsetValues) != 1; got=%v", ns[0].RrsetValues)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestRecordsToNative_2(t *testing.T) {
|
||||
var rcs = []*models.RecordConfig{{}, {}}
|
||||
rcs[0].SetLabelFromFQDN("foo.example.com", "example.com")
|
||||
rcs[0].Type = "A"
|
||||
rcs[0].SetTarget("1.2.3.4")
|
||||
rcs[1].SetLabelFromFQDN("foo.example.com", "example.com")
|
||||
rcs[1].Type = "A"
|
||||
rcs[1].SetTarget("5.6.7.8")
|
||||
|
||||
ns := recordsToNative(rcs, "example.com")
|
||||
|
||||
if len(ns) != 1 {
|
||||
t.Errorf("len(ns) != 1; got=%v", len(ns))
|
||||
}
|
||||
if len(ns[0].RrsetValues) != 2 {
|
||||
t.Errorf("len(ns[0].RrsetValues) != 2; got=%v", ns[0].RrsetValues)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user