One filter in tp_reader

This commit is contained in:
TeoV
2017-10-24 15:00:49 +03:00
committed by Dan Christian Bogos
parent 7a78d074c4
commit 3b880c8c8b
2 changed files with 15 additions and 61 deletions

View File

@@ -1509,7 +1509,7 @@ func TestLoadThresholdProfiles(t *testing.T) {
}
}
func TestLoadFilterProfiles(t *testing.T) {
func TestLoadFilters(t *testing.T) {
eFilters := map[string]map[string]*utils.TPFilter{
"cgrates.org": map[string]*utils.TPFilter{
"FLTR_1": &utils.TPFilter{
@@ -1584,10 +1584,10 @@ func TestLoadFilterProfiles(t *testing.T) {
},
},
}
if len(csvr.flProfiles["cgrates.org"]) != len(eFilters["cgrates.org"]) {
t.Errorf("Failed to load FilterProfiles: %s", utils.ToIJSON(csvr.flProfiles))
} else if !reflect.DeepEqual(eFilters["cgrates.org"]["FLTR_1"], csvr.flProfiles["cgrates.org"]["FLTR_1"]) {
t.Errorf("Expecting: %+v, received: %+v", eFilters["cgrates.org"]["FLTR_1"], csvr.flProfiles["cgrates.org"]["FLTR_1"])
if len(csvr.filters["cgrates.org"]) != len(eFilters["cgrates.org"]) {
t.Errorf("Failed to load FilterProfiles: %s", utils.ToIJSON(csvr.filters))
} else if !reflect.DeepEqual(eFilters["cgrates.org"]["FLTR_1"], csvr.filters["cgrates.org"]["FLTR_1"]) {
t.Errorf("Expecting: %+v, received: %+v", eFilters["cgrates.org"]["FLTR_1"], csvr.filters["cgrates.org"]["FLTR_1"])
}
}
@@ -1637,27 +1637,3 @@ func TestLoadThresholds(t *testing.T) {
t.Errorf("Expecting: %+v, received: %+v", eThresholds, csvr.thresholds)
}
}
func TestLoadFilters(t *testing.T) {
eFilters := []*utils.TenantID{
&utils.TenantID{
Tenant: "cgrates.org",
ID: "FLTR_1",
},
&utils.TenantID{
Tenant: "cgrates.org",
ID: "FLTR_ACNT_dan",
},
&utils.TenantID{
Tenant: "cgrates.org",
ID: "FLTR_DST_DE",
},
&utils.TenantID{
Tenant: "cgrates.org",
ID: "FLTR_DST_NL",
},
}
if len(csvr.filters) != len(eFilters) {
t.Errorf("Failed to load filters: %s", utils.ToIJSON(csvr.filters))
}
}