mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 20:59:53 +05:00
Add test to see if the Opts is sending furder from set operation
This commit is contained in:
committed by
Dan Christian Bogos
parent
92d5436e6b
commit
15bcc8165c
@@ -84,6 +84,7 @@ var (
|
||||
testAttributeSCachingMetaReload1,
|
||||
testAttributeSCachingMetaReload2,
|
||||
testAttributeSCachingMetaRemove,
|
||||
testAttributeSCacheOpts,
|
||||
testAttributeSKillEngine,
|
||||
}
|
||||
)
|
||||
@@ -1786,3 +1787,35 @@ func testAttributeSSetAttributeWithEmptyPath(t *testing.T) {
|
||||
t.Errorf("Expected error received nil")
|
||||
}
|
||||
}
|
||||
|
||||
func testAttributeSCacheOpts(t *testing.T) {
|
||||
attrPrf1 := &AttributeWithCache{
|
||||
AttributeProfile: &engine.AttributeProfile{
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_WITH_OPTS",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:~*req.InitialField:InitialValue"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
Attributes: []*engine.Attribute{
|
||||
{
|
||||
Path: utils.MetaReq + utils.NestingSep + "Field1",
|
||||
Value: config.NewRSRParsersMustCompile("Value1", utils.INFIELD_SEP),
|
||||
},
|
||||
},
|
||||
Weight: 10,
|
||||
},
|
||||
Opts: map[string]interface{}{
|
||||
"Method": "SetAttributeProfile",
|
||||
"CustomField": "somethingCustom",
|
||||
},
|
||||
}
|
||||
// set the profile
|
||||
var result string
|
||||
if err := attrSRPC.Call(utils.APIerSv1SetAttributeProfile, attrPrf1, &result); err != nil {
|
||||
t.Error(err)
|
||||
} else if result != utils.OK {
|
||||
t.Error("Unexpected reply returned", result)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user