mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 22:29:55 +05:00
test action filter csv load
This commit is contained in:
@@ -79,13 +79,15 @@ func (self *ApierV2) GetAccount(attr *utils.AttrGetAccount, reply *engine.Accoun
|
||||
}
|
||||
|
||||
type AttrSetAccount struct {
|
||||
Tenant string
|
||||
Account string
|
||||
ActionPlanId string
|
||||
ActionTriggersId string
|
||||
AllowNegative *bool
|
||||
Disabled *bool
|
||||
ReloadScheduler bool
|
||||
Tenant string
|
||||
Account string
|
||||
ActionPlanIds string
|
||||
ActionPlansOverwrite bool
|
||||
ActionTriggersId string
|
||||
ActionTriggerOverwrite bool
|
||||
AllowNegative *bool
|
||||
Disabled *bool
|
||||
ReloadScheduler bool
|
||||
}
|
||||
|
||||
func (self *ApierV2) SetAccount(attr AttrSetAccount, reply *string) error {
|
||||
|
||||
@@ -1828,6 +1828,16 @@ func TestActionSetBalance(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestActionCSVFilter(t *testing.T) {
|
||||
act, err := ratingStorage.GetActions("FILTER", false)
|
||||
if err != nil {
|
||||
t.Error("error getting actions: ", err)
|
||||
}
|
||||
if len(act) != 1 || act[0].Filter != `{"Type":"*voice","Value":{"*gte":100}}` {
|
||||
t.Error("Error loading actions: ", act[0].Filter)
|
||||
}
|
||||
}
|
||||
|
||||
/**************** Benchmarks ********************************/
|
||||
|
||||
func BenchmarkUUID(b *testing.B) {
|
||||
|
||||
@@ -174,6 +174,7 @@ DEFEE,*cdrlog,"{""Category"":""^ddi"",""MediationRunId"":""^did_run""}",,,,,,,,,
|
||||
NEG,*allow_negative,,,,*monetary,*out,,,,,*unlimited,,0,10,false,false,10
|
||||
BLOCK,*topup,,,bblocker,*monetary,*out,,NAT,,,*unlimited,,10,20,true,false,20
|
||||
BLOCK,*topup,,,bfree,*monetary,*out,,,,,*unlimited,,20,10,false,false,10
|
||||
FILTER,*topup,,"{""Type"":""*voice"",""Value"":{""*gte"":100}}",bfree,*monetary,*out,,,,,*unlimited,,20,10,false,false,10
|
||||
`
|
||||
actionPlans = `
|
||||
MORE_MINUTES,MINI,ONE_TIME_RUN,10
|
||||
@@ -814,7 +815,7 @@ func TestLoadRatingProfiles(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLoadActions(t *testing.T) {
|
||||
if len(csvr.actions) != 10 {
|
||||
if len(csvr.actions) != 11 {
|
||||
t.Error("Failed to load actions: ", len(csvr.actions))
|
||||
}
|
||||
as1 := csvr.actions["MINI"]
|
||||
|
||||
Reference in New Issue
Block a user