Local tests for load from storDb

This commit is contained in:
DanB
2013-11-19 17:19:04 +01:00
parent a1bbe1c7a6
commit 87b6f9c12e

View File

@@ -147,7 +147,7 @@ func TestLoadFromCSV(t *testing.T) {
}
func TestLoadToStorDb(t *testing.T) {
func TestImportToStorDb(t *testing.T) {
if !*testLocal {
return
}
@@ -161,3 +161,43 @@ func TestLoadToStorDb(t *testing.T) {
t.Errorf("Data in storDb is different than expected %v", tpids)
}
}
func TestLoadFromStorDb(t *testing.T) {
if !*testLocal {
return
}
loader := NewDbReader(storDb, dataDbStor, TEST_SQL)
if err := loader.LoadDestinations(); err != nil {
t.Error("Failed loading destinations: ", err.Error())
}
if err := loader.LoadTimings(); err != nil {
t.Error("Failed loading timings: ", err.Error())
}
if err := loader.LoadRates(); err != nil {
t.Error("Failed loading rates: ", err.Error())
}
if err := loader.LoadDestinationRates(); err != nil {
t.Error("Failed loading destination rates: ", err.Error())
}
if err := loader.LoadRatingPlans(); err != nil {
t.Error("Failed loading rating plans: ", err.Error())
}
if err := loader.LoadRatingProfiles(); err != nil {
t.Error("Failed loading rating profiles: ", err.Error())
}
if err := loader.LoadActions(); err != nil {
t.Error("Failed loading actions: ", err.Error())
}
if err := loader.LoadActionTimings(); err != nil {
t.Error("Failed loading action timings: ", err.Error())
}
if err := loader.LoadActionTriggers(); err != nil {
t.Error("Failed loading action triggers: ", err.Error())
}
if err := loader.LoadAccountActions(); err != nil {
t.Error("Failed loading account actions: ", err.Error())
}
if err := loader.WriteToDatabase(true, false); err != nil {
t.Error("Could not write data into dataDb: ", err.Error())
}
}