mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 23:28:44 +05:00
Updated tests with dispatcher hosts
This commit is contained in:
committed by
Dan Christian Bogos
parent
ad54df15f7
commit
b2cd78af5d
@@ -115,6 +115,7 @@ func TestLoaderITRemoveLoad(t *testing.T) {
|
||||
path.Join(*dataDir, "tariffplans", *tpCsvScenario, utils.AttributesCsv),
|
||||
path.Join(*dataDir, "tariffplans", *tpCsvScenario, utils.ChargersCsv),
|
||||
path.Join(*dataDir, "tariffplans", *tpCsvScenario, utils.DispatchersCsv),
|
||||
path.Join(*dataDir, "tariffplans", *tpCsvScenario, utils.DispatcherHostsCsv),
|
||||
), "", "", nil)
|
||||
|
||||
if err = loader.LoadDestinations(); err != nil {
|
||||
@@ -169,7 +170,10 @@ func TestLoaderITRemoveLoad(t *testing.T) {
|
||||
t.Error("Failed loading Charger profiles: ", err.Error())
|
||||
}
|
||||
if err = loader.LoadDispatcherProfiles(); err != nil {
|
||||
t.Error("Failed loading Charger profiles: ", err.Error())
|
||||
t.Error("Failed loading Dispatcher profiles: ", err.Error())
|
||||
}
|
||||
if err = loader.LoadDispatcherHosts(); err != nil {
|
||||
t.Error("Failed loading Dispatcher hosts: ", err.Error())
|
||||
}
|
||||
if err := loader.WriteToDatabase(true, false, false); err != nil {
|
||||
t.Error("Could not write data into dataDb: ", err.Error())
|
||||
@@ -207,6 +211,7 @@ func TestLoaderITLoadFromCSV(t *testing.T) {
|
||||
path.Join(*dataDir, "tariffplans", *tpCsvScenario, utils.AttributesCsv),
|
||||
path.Join(*dataDir, "tariffplans", *tpCsvScenario, utils.ChargersCsv),
|
||||
path.Join(*dataDir, "tariffplans", *tpCsvScenario, utils.DispatchersCsv),
|
||||
path.Join(*dataDir, "tariffplans", *tpCsvScenario, utils.DispatcherHostsCsv),
|
||||
), "", "", nil)
|
||||
|
||||
if err = loader.LoadDestinations(); err != nil {
|
||||
@@ -261,7 +266,10 @@ func TestLoaderITLoadFromCSV(t *testing.T) {
|
||||
t.Error("Failed loading Charger profiles: ", err.Error())
|
||||
}
|
||||
if err = loader.LoadDispatcherProfiles(); err != nil {
|
||||
t.Error("Failed loading Charger profiles: ", err.Error())
|
||||
t.Error("Failed loading Dispatcher profiles: ", err.Error())
|
||||
}
|
||||
if err = loader.LoadDispatcherHosts(); err != nil {
|
||||
t.Error("Failed loading Dispatcher hosts: ", err.Error())
|
||||
}
|
||||
if err := loader.WriteToDatabase(true, false, false); err != nil {
|
||||
t.Error("Could not write data into dataDb: ", err.Error())
|
||||
@@ -458,6 +466,17 @@ func TestLoaderITWriteToDatabase(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
for tenatid, dph := range loader.dispatcherHosts {
|
||||
rcv, err := loader.dm.GetDispatcherHost(tenatid.Tenant, tenatid.ID, false, false, utils.NonTransactional)
|
||||
if err != nil {
|
||||
t.Errorf("Failed GetDispatcherHost, tenant: %s, id: %s, error: %s ", dph.Tenant, dph.ID, err.Error())
|
||||
}
|
||||
dp := APItoDispatcherHost(dph)
|
||||
if !reflect.DeepEqual(dp, rcv) {
|
||||
t.Errorf("Expecting: %v, received: %v", dp, rcv)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Imports data from csv files in tpScenario to storDb
|
||||
|
||||
Reference in New Issue
Block a user