Switch from redis keys to scan for GetKeys driver + tests and fixes

This commit is contained in:
ionutboangiu
2022-07-19 17:34:24 +03:00
committed by Dan Christian Bogos
parent d847ec5d98
commit 6bcb9b0008
15 changed files with 255 additions and 77 deletions

View File

@@ -1051,7 +1051,6 @@ func TestEventChargerMerge(t *testing.T) {
if !reflect.DeepEqual(expEc, eEvChgs) {
t.Errorf("Expected %v \n but received \n %v", ToJSON(expEc), ToJSON(eEvChgs))
}
// fmt.Println(ToJSON(eEvChgs))
}
func TestEventChargesAppendChargeEntry(t *testing.T) {

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package utils
import (
"fmt"
"reflect"
"testing"
"time"
@@ -1534,8 +1533,7 @@ func TestRateSIncrementCostNoID(t *testing.T) {
cost := rIc.Cost(rts)
if cost != nil {
fmt.Println(cost)
t.Error("Expected to be nil")
t.Errorf("expected cost to be nil, received <%+v>", cost)
}
}
@@ -1765,7 +1763,7 @@ func TestRateSIntervalCost(t *testing.T) {
rcv := rIv.Cost(rts)
exp := decimal.WithContext(DecimalContext).SetUint64(2)
if !reflect.DeepEqual(rcv, exp) {
fmt.Printf("Expected %v \n but received \n %v", exp, rcv)
t.Errorf("expected <%v>,\nreceived <%v>", exp, rcv)
}
}

View File

@@ -299,7 +299,6 @@ func TestStringSetFieldAsInterface(t *testing.T) {
if err != nil {
t.Error(err)
}
// fmt.Println(rcv)
_, err = s.FieldAsInterface([]string{"field2"})
if err != ErrNotFound {
t.Errorf("Expected %v", ErrNotFound)

View File

@@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package utils
import (
"fmt"
"math/cmplx"
"reflect"
"testing"
@@ -236,6 +235,6 @@ func TestContentStructFieldByIndexIsEmpty(t *testing.T) {
},
}
if fieldByIndexIsEmpty(reflect.ValueOf(myStruct), []int{1, 0}) {
fmt.Printf("%v", myStruct)
t.Errorf("%v", myStruct)
}
}