From d1277fe83c43a0342fea151abf18c5f1189b49c3 Mon Sep 17 00:00:00 2001 From: TeoV Date: Wed, 8 May 2019 10:28:11 +0300 Subject: [PATCH] Rename tests with the right ones --- apier/v2/cdrs_offline_it_test.go | 13 ++++++------- engine/account_test.go | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/apier/v2/cdrs_offline_it_test.go b/apier/v2/cdrs_offline_it_test.go index f91ef4973..46ae99b70 100644 --- a/apier/v2/cdrs_offline_it_test.go +++ b/apier/v2/cdrs_offline_it_test.go @@ -49,7 +49,7 @@ var sTestsCDRsOfflineIT = []func(t *testing.T){ testV2CDRsOfflineLoadData, testV2CDRsOfflineBalanceUpdate, testV2CDRsOfflineExpiryBalance, - testV2CDRsSpecialCase, + testV2CDRsBalancesWithSameWeight, testV2CDRsOfflineKillEngine, } @@ -121,7 +121,6 @@ func testV2CDRsOfflineLoadData(t *testing.T) { } func testV2CDRsOfflineBalanceUpdate(t *testing.T) { - //add a test account with balance type monetary and value 10 attrs := &utils.AttrSetBalance{ Tenant: "cgrates.org", @@ -214,7 +213,6 @@ func testV2CDRsOfflineBalanceUpdate(t *testing.T) { } func testV2CDRsOfflineExpiryBalance(t *testing.T) { - var reply string acc := &utils.AttrSetActions{ActionsId: "ACT_TOPUP_TEST2", Actions: []*utils.TPAction{ &utils.TPAction{Identifier: engine.TOPUP, BalanceType: utils.MONETARY, BalanceId: "BalanceExpired1", Units: "5", @@ -329,7 +327,7 @@ func testV2CDRsOfflineExpiryBalance(t *testing.T) { time.Sleep(time.Duration(150) * time.Millisecond) // Give time for CDR to be rated } -func testV2CDRsSpecialCase(t *testing.T) { +func testV2CDRsBalancesWithSameWeight(t *testing.T) { //add a test account with balance type monetary and value 10 attrs := &utils.AttrSetBalance{ Tenant: "cgrates.org", @@ -348,7 +346,8 @@ func testV2CDRsSpecialCase(t *testing.T) { t.Fatal(err) } var acnt *engine.Account - if err := cdrsOfflineRpc.Call("ApierV2.GetAccount", &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "specialTest"}, &acnt); err != nil { + if err := cdrsOfflineRpc.Call("ApierV2.GetAccount", + &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "specialTest"}, &acnt); err != nil { t.Error(err) } else if len(acnt.BalanceMap) != 1 || len(acnt.BalanceMap[utils.MONETARY]) != 2 { t.Errorf("Unexpected balance received: %+v", acnt.BalanceMap[utils.MONETARY]) @@ -357,9 +356,9 @@ func testV2CDRsSpecialCase(t *testing.T) { cgrEv := &utils.CGREvent{ Tenant: "cgrates.org", Event: map[string]interface{}{ - utils.OriginID: "testV2CDRsSpecialCase", + utils.OriginID: "testV2CDRsBalancesWithSameWeight", utils.OriginHost: "192.168.1.1", - utils.Source: "testV2CDRsSpecialCase", + utils.Source: "testV2CDRsBalancesWithSameWeight", utils.RequestType: utils.META_POSTPAID, utils.Category: "call", utils.Account: "specialTest", diff --git a/engine/account_test.go b/engine/account_test.go index 3fa5b3d31..c5ec77587 100644 --- a/engine/account_test.go +++ b/engine/account_test.go @@ -2186,7 +2186,7 @@ func TestAccountAsAccountDigest(t *testing.T) { } } -func TestAccountGetBalancesForPrefixSpecialCases(t *testing.T) { +func TestAccountGetBalancesGetBalanceWithSameWeight(t *testing.T) { acc := &Account{ BalanceMap: map[string]Balances{ utils.MONETARY: Balances{ @@ -2209,7 +2209,7 @@ func TestAccountGetBalancesForPrefixSpecialCases(t *testing.T) { } } -func TestAccountGetBalancesForPrefixSpecialCases2(t *testing.T) { +func TestAccountGetBalancesForPrefix2(t *testing.T) { acc := &Account{ BalanceMap: map[string]Balances{ utils.MONETARY: Balances{ @@ -2232,7 +2232,7 @@ func TestAccountGetBalancesForPrefixSpecialCases2(t *testing.T) { } } -func TestAccountGetBalancesForPrefixSpecialCases3(t *testing.T) { +func TestAccountGetMultipleBalancesForPrefixWithSameWeight(t *testing.T) { acc := &Account{ BalanceMap: map[string]Balances{ utils.MONETARY: Balances{