1 Star 0 Fork 0

yeeeeeeeeee/confd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config_test.go 734 Bytes
一键复制 编辑 原始数据 按行查看 历史
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)
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yejinlei/confd.git
git@gitee.com:yejinlei/confd.git
yejinlei
confd
confd
master

搜索帮助