mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 23:58:44 +05:00
Testing GetFromCache
This commit is contained in:
@@ -268,20 +268,11 @@ func testOnStorITCacheDestinations(t *testing.T) {
|
||||
if err := onStor.CacheDataFromDB(utils.DESTINATION_PREFIX, []string{dst.Id}, false); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if err = onStor.SelectDatabase("13"); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if _, rcvErr := onStor.GetReverseDestination(dst.Id, true, utils.NonTransactional); rcvErr != utils.ErrNotFound {
|
||||
t.Error(rcvErr)
|
||||
}
|
||||
if itm, hasIt := cache.Get(utils.DESTINATION_PREFIX + dst.Id); !hasIt {
|
||||
t.Error("Did not cache")
|
||||
} else if !reflect.DeepEqual(dst, itm.(*Destination)) {
|
||||
t.Error("Wrong item in the cache")
|
||||
}
|
||||
if err = onStor.SelectDatabase(dbnames); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func testOnStorITCacheReverseDestinations(t *testing.T) {
|
||||
@@ -893,6 +884,22 @@ func testOnStorITCRUDRatingPlan(t *testing.T) {
|
||||
} else if !reflect.DeepEqual(rp, rcv) {
|
||||
t.Errorf("Expecting: %v, received: %v", rp, rcv)
|
||||
}
|
||||
// FixMe
|
||||
//if err = onStor.SelectDatabase("13"); err != nil {
|
||||
// t.Error(err)
|
||||
// }
|
||||
// if _, rcvErr := onStor.GetRatingPlan(rp.Id, true, utils.NonTransactional); rcvErr != utils.ErrNotFound {
|
||||
// t.Error(rcvErr)
|
||||
// }
|
||||
//
|
||||
// if rcv, err := onStor.GetRatingPlan(rp.Id, false, utils.NonTransactional); err != nil {
|
||||
// t.Error(err)
|
||||
// } else if !reflect.DeepEqual(rp, rcv) {
|
||||
// t.Errorf("Expecting: %v, received: %v", rp, rcv)
|
||||
// }
|
||||
// if err = onStor.SelectDatabase(dbnames); err != nil {
|
||||
// t.Error(err)
|
||||
// }
|
||||
}
|
||||
|
||||
func testOnStorITCRUDRatingProfile(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user