From c4d70d4fea3a1f5e08a38d9eb16f9f3681605547 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Fri, 5 Feb 2016 15:42:11 +0200 Subject: [PATCH] tests order --- apier/v1/apier_local_test.go | 70 ++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/apier/v1/apier_local_test.go b/apier/v1/apier_local_test.go index b66cdf880..efbd485de 100644 --- a/apier/v1/apier_local_test.go +++ b/apier/v1/apier_local_test.go @@ -1039,41 +1039,6 @@ func TestApierGetAccountActionTriggers(t *testing.T) { } } -// Test here RemAccountActionTriggers -func TestApierRemAccountActionTriggers(t *testing.T) { - if !*testLocal { - return - } - // Test first get so we can steal the id which we need to remove - var reply engine.ActionTriggers - req := AttrAcntAction{Tenant: "cgrates.org", Account: "dan2"} - if err := rater.Call("ApierV1.GetAccountActionTriggers", req, &reply); err != nil { - t.Error("Got error on ApierV1.GetAccountActionTimings: ", err.Error()) - } else if len(reply) != 1 || reply[0].ActionsId != "LOG_BALANCE" { - for _, atr := range reply { - t.Logf("ATR: %+v", atr) - } - t.Errorf("Unexpected action triggers received %v", reply) - } - var rmReply string - rmReq := AttrRemoveAccountActionTriggers{Tenant: "cgrates.org", Account: "dan2", UniqueID: reply[0].UniqueID} - if err := rater.Call("ApierV1.ResetAccountActionTriggers", rmReq, &rmReply); err != nil { - t.Error("Got error on ApierV1.ResetActionTiming: ", err.Error()) - } else if rmReply != OK { - t.Error("Unexpected answer received", rmReply) - } - if err := rater.Call("ApierV1.RemoveAccountActionTriggers", rmReq, &rmReply); err != nil { - t.Error("Got error on ApierV1.RemoveActionTiming: ", err.Error()) - } else if rmReply != OK { - t.Error("Unexpected answer received", rmReply) - } - if err := rater.Call("ApierV1.GetAccountActionTriggers", req, &reply); err != nil { - t.Error("Got error on ApierV1.GetAccountActionTriggers: ", err.Error()) - } else if len(reply) != 0 { - t.Errorf("Unexpected action triggers received %+v", reply[0]) - } -} - // Test here SetAccountActionTriggers func TestApierSetAccountActionTriggers(t *testing.T) { if !*testLocal { @@ -1109,6 +1074,41 @@ func TestApierSetAccountActionTriggers(t *testing.T) { } } +// Test here RemAccountActionTriggers +func TestApierRemAccountActionTriggers(t *testing.T) { + if !*testLocal { + return + } + // Test first get so we can steal the id which we need to remove + var reply engine.ActionTriggers + req := AttrAcntAction{Tenant: "cgrates.org", Account: "dan2"} + if err := rater.Call("ApierV1.GetAccountActionTriggers", req, &reply); err != nil { + t.Error("Got error on ApierV1.GetAccountActionTimings: ", err.Error()) + } else if len(reply) != 1 || reply[0].ActionsId != "LOG_BALANCE" { + for _, atr := range reply { + t.Logf("ATR: %+v", atr) + } + t.Errorf("Unexpected action triggers received %v", reply) + } + var rmReply string + rmReq := AttrRemoveAccountActionTriggers{Tenant: "cgrates.org", Account: "dan2", UniqueID: reply[0].UniqueID} + if err := rater.Call("ApierV1.ResetAccountActionTriggers", rmReq, &rmReply); err != nil { + t.Error("Got error on ApierV1.ResetActionTiming: ", err.Error()) + } else if rmReply != OK { + t.Error("Unexpected answer received", rmReply) + } + if err := rater.Call("ApierV1.RemoveAccountActionTriggers", rmReq, &rmReply); err != nil { + t.Error("Got error on ApierV1.RemoveActionTiming: ", err.Error()) + } else if rmReply != OK { + t.Error("Unexpected answer received", rmReply) + } + if err := rater.Call("ApierV1.GetAccountActionTriggers", req, &reply); err != nil { + t.Error("Got error on ApierV1.GetAccountActionTriggers: ", err.Error()) + } else if len(reply) != 0 { + t.Errorf("Unexpected action triggers received %+v", reply[0]) + } +} + // Test here SetAccount func TestApierSetAccount(t *testing.T) { if !*testLocal {