forked from kelseyhightower/confd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_test.go
34 lines (31 loc) · 734 Bytes
/
config_test.go
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
package main
import (
"reflect"
"testing"
"github.com/kelseyhightower/confd/log"
)
func TestInitConfigDefaultConfig(t *testing.T) {
log.SetLevel("warn")
want := Config{
BackendsConfig: BackendsConfig{
Backend: "etcd",
BackendNodes: []string{"http://127.0.0.1:4001"},
Scheme: "http",
Filter: "*",
},
TemplateConfig: TemplateConfig{
ConfDir: "/etc/confd",
ConfigDir: "/etc/confd/conf.d",
TemplateDir: "/etc/confd/templates",
Noop: false,
},
ConfigFile: "/etc/confd/confd.toml",
Interval: 600,
}
if err := initConfig(); err != nil {
t.Errorf(err.Error())
}
if !reflect.DeepEqual(want, config) {
t.Errorf("initConfig() = %v, want %v", config, want)
}
}