history test improvement

This commit is contained in:
Radu Ioan Fericean
2015-11-11 15:54:25 +02:00
parent cad349f2aa
commit da8befda62
2 changed files with 3 additions and 4 deletions

View File

@@ -1234,6 +1234,7 @@ func TestActionCdrLogParamsWithOverload(t *testing.T) {
func TestActionSetDDestination(t *testing.T) {
acc := &Account{BalanceMap: map[string]BalanceChain{utils.MONETARY: BalanceChain{&Balance{DestinationIds: utils.NewStringMap("*ddc_test")}}}}
origD := &Destination{Id: "*ddc_test", Prefixes: []string{"111", "222"}}
alteredD := &Destination{Id: "*ddc_test", Prefixes: []string{"333", "444"}}
ratingStorage.SetDestination(origD)
ratingStorage.CacheRatingPrefixValues(map[string][]string{utils.DESTINATION_PREFIX: []string{utils.DESTINATION_PREFIX + "*ddc_test"}})
// check redis and cache
@@ -1249,8 +1250,7 @@ func TestActionSetDDestination(t *testing.T) {
t.Error("Error cacheing destination: ", x1)
}
setddestinations(acc, &StatsQueueTriggered{Metrics: map[string]float64{"333": 1, "444": 1}}, nil, nil)
alteredDest := &Destination{Id: "*ddc_test", Prefixes: []string{"333", "444"}}
if d, err := ratingStorage.GetDestination("*ddc_test"); err != nil || !reflect.DeepEqual(d, alteredDest) {
if d, err := ratingStorage.GetDestination("*ddc_test"); err != nil || !reflect.DeepEqual(d, alteredD) {
t.Error("Error storing destination: ", d, err)
}
x1, err = cache2go.Get(utils.DESTINATION_PREFIX + "111")

View File

@@ -36,8 +36,7 @@ func TestHistoryRatinPlans(t *testing.T) {
func TestHistoryDestinations(t *testing.T) {
scribe := historyScribe.(*history.MockScribe)
buf := scribe.GetBuffer(history.DESTINATIONS_FN)
expected := `[{"Id":"*ddc_test","Prefixes":["333","444"]},
{"Id":"ALL","Prefixes":["49","41","43"]},
expected := `{"Id":"ALL","Prefixes":["49","41","43"]},
{"Id":"DST_UK_Mobile_BIG5","Prefixes":["447956"]},
{"Id":"EU_LANDLINE","Prefixes":["444"]},
{"Id":"GERMANY","Prefixes":["49"]},