aboutsummaryrefslogtreecommitdiff
path: root/core/dns/storage_test.go
blob: 859435a15e6543a21e448ef08b9f6be35f8846c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package dns

import (
	"path/filepath"
	"testing"
)

func TestStorage(t *testing.T) {
	storage = Storage("./le_test")

	if expected, actual := filepath.Join("le_test", "zones"), storage.Zones(); actual != expected {
		t.Errorf("Expected Zones() to return '%s' but got '%s'", expected, actual)
	}
	if expected, actual := filepath.Join("le_test", "zones", "test.com"), storage.Zone("test.com"); actual != expected {
		t.Errorf("Expected Site() to return '%s' but got '%s'", expected, actual)
	}
	if expected, actual := filepath.Join("le_test", "zones", "test.com", "db.test.com"), storage.SecondaryZoneFile("test.com"); actual != expected {
		t.Errorf("Expected SecondaryZoneFile() to return '%s' but got '%s'", expected, actual)
	}
}