mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 14:19:54 +05:00
Test fixes
This commit is contained in:
@@ -713,6 +713,7 @@ func (cd *CallDescriptor) Debit() (cc *CallCost, err error) {
|
||||
}
|
||||
_, err = guardian.Guardian.Guard(func() (iface interface{}, err error) {
|
||||
cc, err = cd.debit(account, cd.DryRun, !cd.DenyNegativeAccount)
|
||||
cc.AccountSummary = cd.AccountSummary()
|
||||
return
|
||||
}, 0, lkIDs...)
|
||||
return
|
||||
|
||||
@@ -1316,7 +1316,8 @@ func TestDebitAndMaxDebit(t *testing.T) {
|
||||
// make Unit.Values have the same value
|
||||
cc1.Timespans[0].Increments[0].BalanceInfo.Unit.Value = 0
|
||||
cc2.Timespans[0].Increments[0].BalanceInfo.Unit.Value = 0
|
||||
if !reflect.DeepEqual(cc1, cc2) {
|
||||
cc1.AccountSummary, cc2.AccountSummary = nil, nil // account changes, enforce here emptying the info so reflect can pass
|
||||
if !reflect.DeepEqual(cc1.Timespans, cc2.Timespans) {
|
||||
t.Log("CC1: ", utils.ToIJSON(cc1))
|
||||
t.Log("CC2: ", utils.ToIJSON(cc2))
|
||||
t.Error("Debit and MaxDebit differ")
|
||||
|
||||
@@ -354,9 +354,6 @@ func (cIl *ChargingInterval) GetCost() float64 {
|
||||
var cost float64
|
||||
for _, incr := range cIl.Increments {
|
||||
cost += incr.Cost * float64(incr.CompressFactor)
|
||||
}
|
||||
if cIl.RoundingIncrement != nil {
|
||||
|
||||
}
|
||||
cost = utils.Round(cost, globalRoundingDecimals, utils.ROUNDING_MIDDLE)
|
||||
cIl.Cost = &cost
|
||||
|
||||
Reference in New Issue
Block a user