mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 02:26:26 +05:00
Small correction Apier test
This commit is contained in:
@@ -1167,32 +1167,32 @@ func TestApierGetAccount(t *testing.T) {
|
||||
if err := rater.Call("ApierV1.GetAccount", attrs, &reply); err != nil {
|
||||
t.Error("Got error on ApierV1.GetAccount: ", err.Error())
|
||||
} else if reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue() != 11.5 { // We expect 11.5 since we have added in the previous test 1.5
|
||||
t.Errorf("Calling ApierV1.GetBalance expected: 11.5, received: %f", reply)
|
||||
t.Errorf("Calling ApierV1.GetBalance expected: 11.5, received: %f", reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue())
|
||||
}
|
||||
attrs = &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "dan", Direction: "*out"}
|
||||
if err := rater.Call("ApierV1.GetAccount", attrs, &reply); err != nil {
|
||||
t.Error("Got error on ApierV1.GetAccount: ", err.Error())
|
||||
} else if reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue() != 1.5 {
|
||||
t.Errorf("Calling ApierV1.GetAccount expected: 1.5, received: %f", reply)
|
||||
t.Errorf("Calling ApierV1.GetAccount expected: 1.5, received: %f", reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue())
|
||||
}
|
||||
// The one we have topped up though executeAction
|
||||
attrs = &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "dan2", Direction: "*out"}
|
||||
if err := rater.Call("ApierV1.GetAccount", attrs, &reply); err != nil {
|
||||
t.Error("Got error on ApierV1.GetAccount: ", err.Error())
|
||||
} else if reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue() != 10 {
|
||||
t.Errorf("Calling ApierV1.GetAccount expected: 10, received: %f", reply)
|
||||
t.Errorf("Calling ApierV1.GetAccount expected: 10, received: %f", reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue())
|
||||
}
|
||||
attrs = &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "dan3", Direction: "*out"}
|
||||
if err := rater.Call("ApierV1.GetAccount", attrs, &reply); err != nil {
|
||||
t.Error("Got error on ApierV1.GetAccount: ", err.Error())
|
||||
} else if reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue() != 3.6 {
|
||||
t.Errorf("Calling ApierV1.GetAccount expected: 3.6, received: %f", reply)
|
||||
t.Errorf("Calling ApierV1.GetAccount expected: 3.6, received: %f", reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue())
|
||||
}
|
||||
attrs = &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "dan6", Direction: "*out"}
|
||||
if err := rater.Call("ApierV1.GetAccount", attrs, &reply); err != nil {
|
||||
t.Error("Got error on ApierV1.GetAccount: ", err.Error())
|
||||
} else if reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue() != 1 {
|
||||
t.Errorf("Calling ApierV1.GetAccount expected: 1, received: %f", reply)
|
||||
t.Errorf("Calling ApierV1.GetAccount expected: 1, received: %f", reply.BalanceMap[engine.CREDIT+attrs.Direction].GetTotalValue())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,10 +147,10 @@ CREATE TABLE `tp_actions` (
|
||||
`action` varchar(24) NOT NULL,
|
||||
`balance_tag` varchar(64) NOT NULL,
|
||||
`balance_type` varchar(24) NOT NULL,
|
||||
`balance_direction` varchar(8) NOT NULL,
|
||||
`direction` varchar(8) NOT NULL,
|
||||
`units` DECIMAL(20,4) NOT NULL,
|
||||
`expiry_time` varchar(24) NOT NULL,
|
||||
`balance_destination_tag` varchar(64) NOT NULL,
|
||||
`destination_tag` varchar(64) NOT NULL,
|
||||
`rating_subject` varchar(64) NOT NULL,
|
||||
`category` varchar(16) NOT NULL,
|
||||
`shared_group` varchar(64) NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user