Test for reverse destinations and aliases

This commit is contained in:
DanB
2017-01-04 19:55:14 +01:00
parent 4da0f5dd07
commit 3f69407c5a

View File

@@ -385,6 +385,30 @@ func TestLoadDestinations(t *testing.T) {
}
}
func TestLoadReverseDestinations(t *testing.T) {
eRevDsts := map[string][]string{
"444": []string{"EU_LANDLINE"},
"0257": []string{"NAT"},
"112": []string{"URG"},
"49": []string{"ALL GERMANY"},
"+4972": []string{"PSTN_72"},
"999": []string{"EXOTIC"},
"+4970": []string{"PSTN_70"},
"41": []string{"ALL GERMANY_O2"},
"0724": []string{"RET"},
"0723045": []string{"SPEC"},
"43": []string{"GERMANY_PREMIUM ALL"},
"0256": []string{"NAT"},
"+49": []string{"NAT"},
"+4971": []string{"PSTN_71"},
"447956": []string{"DST_UK_Mobile_BIG5"},
"0723": []string{"RET NAT"},
}
if len(eRevDsts) != len(csvr.revDests) {
t.Errorf("Expecting: %+v, received: %+v", eRevDsts, csvr.revDests)
}
}
func TestLoadTimimgs(t *testing.T) {
if len(csvr.timings) != 6 {
t.Error("Failed to load timings: ", csvr.timings)
@@ -1337,6 +1361,21 @@ func TestLoadAliases(t *testing.T) {
}
}
func TestLoadReverseAliases(t *testing.T) {
eRevAliases := map[string][]string{
"minuAccount*rating": []string{"*out:cgrates.org:call:remo:remo:*rating:*any", "*out:vdf:0:a1:a1:*rating:*any"},
"dan1Subject*rating": []string{"*out:cgrates.org:call:dan:dan:*rating:EU_LANDLINE"},
"rif1Subject*rating": []string{"*out:cgrates.org:call:dan:dan:*rating:EU_LANDLINE", "*any:*any:*any:*any:*any:*rating:*any"},
"0724Cli*rating": []string{"*out:cgrates.org:call:dan:dan:*rating:EU_LANDLINE"},
"dan2Subject*rating": []string{"*out:cgrates.org:call:dan:dan:*rating:GLOBAL1"},
"dan1Account*rating": []string{"*any:*any:*any:*any:*any:*rating:*any"},
"minuSubject*rating": []string{"*out:cgrates.org:call:remo:remo:*rating:*any", "*out:vdf:0:a1:a1:*rating:*any"},
}
if len(eRevAliases) != len(csvr.revAliases) {
t.Errorf("Expecting: %+v, received: %+v", eRevAliases, csvr.revAliases)
}
}
func TestLoadResourceLimits(t *testing.T) {
eResLimits := map[string]*utils.TPResourceLimit{
"ResGroup1": &utils.TPResourceLimit{