mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Cover tests in dispatchers
This commit is contained in:
committed by
Dan Christian Bogos
parent
9dc2762b97
commit
d3e73360ad
@@ -844,3 +844,32 @@ func TestLibDispatcherSingleResultStrategyDispatcherCastError(t *testing.T) {
|
||||
}
|
||||
engine.Cache = cacheInit
|
||||
}
|
||||
|
||||
/*
|
||||
func TestLibDispatcherSingleResultStrategyDispatcherCastError2(t *testing.T) {
|
||||
cacheInit := engine.Cache
|
||||
cfg := config.NewDefaultCGRConfig()
|
||||
dm := engine.NewDataManager(nil, nil, nil)
|
||||
newCache := engine.NewCacheS(cfg, dm, nil)
|
||||
engine.Cache = newCache
|
||||
value := &engine.DispatcherHost{
|
||||
Tenant: "testTenant",
|
||||
RemoteHost: &config.RemoteHost{
|
||||
ID: "testID",
|
||||
Address: "",
|
||||
Transport: "",
|
||||
Synchronous: false,
|
||||
TLS: false,
|
||||
},
|
||||
}
|
||||
engine.Cache.SetWithoutReplicate(utils.CacheDispatcherRoutes, "testID:*attributes",
|
||||
value, nil, true, utils.NonTransactional)
|
||||
wgDsp := &singleResultstrategyDispatcher{}
|
||||
err := wgDsp.dispatch(nil, "testID", utils.MetaAttributes, "testTenant", []string{"testID"}, utils.AttributeSv1Ping, &utils.CGREvent{}, "")
|
||||
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
||||
if err == nil || err.Error() != expected {
|
||||
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, err)
|
||||
}
|
||||
engine.Cache = cacheInit
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user