Add confil filters tests

This commit is contained in:
TeoV
2017-11-14 10:56:31 +02:00
committed by Dan Christian Bogos
parent 73451d4f1a
commit 09d517d984
2 changed files with 21 additions and 1 deletions

View File

@@ -688,6 +688,17 @@ func TestDfUserServJsonCfg(t *testing.T) {
}
}
func TestDfFilterSJsonCfg(t *testing.T) {
eCfg := &FilterSJsonCfg{
Stats_conns: &[]*HaPoolJsonCfg{},
}
if cfg, err := dfCgrJsonCfg.FilterSJsonCfg(); err != nil {
t.Error(err)
} else if !reflect.DeepEqual(eCfg, cfg) {
t.Errorf("Expected: %s, received: %s", utils.ToJSON(eCfg), utils.ToJSON(cfg))
}
}
func TestDfResourceLimiterSJsonCfg(t *testing.T) {
eCfg := &ResourceSJsonCfg{
Enabled: utils.BoolPointer(false),

View File

@@ -269,7 +269,7 @@ func TestCgrCfgJSONDefaultsStorDB(t *testing.T) {
}
func TestCgrCfgJSONDefaultsRALs(t *testing.T) {
//asd
eHaPoolcfg := []*HaPoolConfig{}
if cgrCfg.RALsEnabled != false {
@@ -580,6 +580,15 @@ func TestCgrCfgJSONDefaultsUserS(t *testing.T) {
}
}
func TestCgrCfgJSONDefaultFiltersCfg(t *testing.T) {
eFiltersCfg := &FilterSCfg{
StatSConns: []*HaPoolConfig{},
}
if !reflect.DeepEqual(cgrCfg.filterSCfg, eFiltersCfg) {
t.Errorf("received: %+v, expecting: %+v", cgrCfg.filterSCfg, eFiltersCfg)
}
}
func TestCgrCfgJSONDefaultsResLimCfg(t *testing.T) {
eResLiCfg := &ResourceSConfig{
Enabled: false,