mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Improving Coverage at Config
This commit is contained in:
committed by
Dan Christian Bogos
parent
fd0bec2e10
commit
4a01e20569
@@ -371,3 +371,26 @@ func TestActionSCloneSection(t *testing.T) {
|
||||
t.Errorf("Expected %v \n but received \n %v", exp, actCfg)
|
||||
}
|
||||
}
|
||||
func TestDiffActionsOptsJsonCfg(t *testing.T) {
|
||||
d := &ActionsOptsJson{}
|
||||
v1 := &ActionsOpts{
|
||||
PosterAttempts: []*utils.DynamicIntOpt{},
|
||||
}
|
||||
v2 := &ActionsOpts{
|
||||
PosterAttempts: []*utils.DynamicIntOpt{{
|
||||
FilterIDs: []string{"fltr1"},
|
||||
},
|
||||
},
|
||||
}
|
||||
exp := &ActionsOptsJson{
|
||||
|
||||
PosterAttempts: []*utils.DynamicIntOpt{{
|
||||
FilterIDs: []string{"fltr1"},
|
||||
},
|
||||
},
|
||||
}
|
||||
if rcv := diffActionsOptsJsonCfg(d, v1, v2); utils.ToJSON(rcv) != utils.ToJSON(exp) {
|
||||
t.Errorf("Expected <%v> \n Received \n <%v>", exp, rcv)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -204,3 +204,41 @@ func TestAnalyzerSCloneSection(t *testing.T) {
|
||||
t.Errorf("Expected %v \n but received \n %v", utils.ToJSON(exp), utils.ToJSON(anlCfg))
|
||||
}
|
||||
}
|
||||
|
||||
// //unfinished
|
||||
// func TestToLoadFromJSONCfg(t *testing.T) {
|
||||
// anzOpts := &AnalyzerSOpts{
|
||||
// ExporterIDs: []*utils.DynamicStringSliceOpt{
|
||||
// {
|
||||
// FilterIDs: []string{"filtr1"},
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
// var jsonAnzOpts *AnalyzerSOptsJson
|
||||
|
||||
// anzOpts.loadFromJSONCfg(jsonAnzOpts)
|
||||
|
||||
// }
|
||||
|
||||
func TestDiffAnalyzerSOptsJsonCfg(t *testing.T) {
|
||||
d := &AnalyzerSOptsJson{}
|
||||
v1 := &AnalyzerSOpts{
|
||||
ExporterIDs: []*utils.DynamicStringSliceOpt{},
|
||||
}
|
||||
v2 := &AnalyzerSOpts{
|
||||
ExporterIDs: []*utils.DynamicStringSliceOpt{{
|
||||
FilterIDs: []string{"test"},
|
||||
},
|
||||
},
|
||||
}
|
||||
exp := &AnalyzerSOptsJson{
|
||||
|
||||
ExporterIDs: []*utils.DynamicStringSliceOpt{{
|
||||
FilterIDs: []string{"test"},
|
||||
},
|
||||
},
|
||||
}
|
||||
if rcv := diffAnalyzerSOptsJsonCfg(d, v1, v2); utils.ToJSON(rcv) != utils.ToJSON(exp) {
|
||||
t.Errorf("Expected <%v> \n Received \n <%v>", exp, rcv)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user