mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Update integration test for tp
This commit is contained in:
committed by
Dan Christian Bogos
parent
d52e62daf3
commit
f42ba86f84
@@ -1244,7 +1244,7 @@ func testStorDBitCRUDTpAliases(t *testing.T) {
|
||||
|
||||
func testStorDBitCRUDTpResources(t *testing.T) {
|
||||
// READ
|
||||
if _, err := storDB.GetTPResources("testTPid", ""); err != utils.ErrNotFound {
|
||||
if _, err := storDB.GetTPResources("testTPid", "", ""); err != utils.ErrNotFound {
|
||||
t.Error(err)
|
||||
}
|
||||
//WRITE
|
||||
@@ -1275,7 +1275,7 @@ func testStorDBitCRUDTpResources(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
// READ
|
||||
if rcv, err := storDB.GetTPResources("testTPid", ""); err != nil {
|
||||
if rcv, err := storDB.GetTPResources("testTPid", "", ""); err != nil {
|
||||
t.Error(err)
|
||||
} else {
|
||||
if !(reflect.DeepEqual(snd[0].TPid, rcv[0].TPid) || reflect.DeepEqual(snd[0].TPid, rcv[1].TPid)) {
|
||||
@@ -1304,7 +1304,7 @@ func testStorDBitCRUDTpResources(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
// READ
|
||||
if rcv, err := storDB.GetTPResources("testTPid", ""); err != nil {
|
||||
if rcv, err := storDB.GetTPResources("testTPid", "", ""); err != nil {
|
||||
t.Error(err)
|
||||
} else {
|
||||
if !(reflect.DeepEqual(snd[0].TPid, rcv[0].TPid) || reflect.DeepEqual(snd[0].TPid, rcv[1].TPid)) {
|
||||
@@ -1332,14 +1332,14 @@ func testStorDBitCRUDTpResources(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
// READ
|
||||
if _, err := storDB.GetTPResources("testTPid", ""); err != utils.ErrNotFound {
|
||||
if _, err := storDB.GetTPResources("testTPid", "", ""); err != utils.ErrNotFound {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func testStorDBitCRUDTpStats(t *testing.T) {
|
||||
// READ
|
||||
if _, err := storDB.GetTPStats("TEST_TPID", ""); err != utils.ErrNotFound {
|
||||
if _, err := storDB.GetTPStats("TEST_TPID", "", ""); err != utils.ErrNotFound {
|
||||
t.Error(err)
|
||||
}
|
||||
//WRITE
|
||||
@@ -1378,7 +1378,7 @@ func testStorDBitCRUDTpStats(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
// READ
|
||||
if rcv, err := storDB.GetTPStats("TEST_TPID", ""); err != nil {
|
||||
if rcv, err := storDB.GetTPStats("TEST_TPID", "", ""); err != nil {
|
||||
t.Error(err)
|
||||
} else {
|
||||
if !(reflect.DeepEqual(eTPs[0].TPid, rcv[0].TPid) || reflect.DeepEqual(eTPs[0].TPid, rcv[1].TPid)) {
|
||||
@@ -1401,7 +1401,7 @@ func testStorDBitCRUDTpStats(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
// READ
|
||||
if rcv, err := storDB.GetTPStats("TEST_TPID", ""); err != nil {
|
||||
if rcv, err := storDB.GetTPStats("TEST_TPID", "", ""); err != nil {
|
||||
t.Error(err)
|
||||
} else {
|
||||
if !(reflect.DeepEqual(eTPs[0].TPid, rcv[0].TPid) || reflect.DeepEqual(eTPs[0].TPid, rcv[1].TPid)) {
|
||||
@@ -1424,7 +1424,7 @@ func testStorDBitCRUDTpStats(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
// READ
|
||||
if _, err := storDB.GetTPStats("TEST_TPID", ""); err != utils.ErrNotFound {
|
||||
if _, err := storDB.GetTPStats("TEST_TPID", "", ""); err != utils.ErrNotFound {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ func testTpResITMove(t *testing.T) {
|
||||
|
||||
func testTpResITCheckData(t *testing.T) {
|
||||
result, err := tpResMigrator.storDBOut.StorDB().GetTPResources(
|
||||
tpResources[0].TPid, tpResources[0].ID)
|
||||
tpResources[0].TPid, "", tpResources[0].ID)
|
||||
if err != nil {
|
||||
t.Error("Error when getting TpResources ", err.Error())
|
||||
}
|
||||
@@ -156,7 +156,7 @@ func testTpResITCheckData(t *testing.T) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(tpResources[0]), utils.ToJSON(result[0]))
|
||||
}
|
||||
result, err = tpResMigrator.storDBIn.StorDB().GetTPResources(
|
||||
tpResources[0].TPid, tpResources[0].ID)
|
||||
tpResources[0].TPid, "", tpResources[0].ID)
|
||||
if err != utils.ErrNotFound {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ func testTpStatsITMove(t *testing.T) {
|
||||
|
||||
func testTpStatsITCheckData(t *testing.T) {
|
||||
result, err := tpStatsMigrator.storDBOut.StorDB().GetTPStats(
|
||||
tpStats[0].TPid, tpStats[0].ID)
|
||||
tpStats[0].TPid, "", tpStats[0].ID)
|
||||
if err != nil {
|
||||
t.Error("Error when getting TpStat ", err.Error())
|
||||
}
|
||||
@@ -160,7 +160,7 @@ func testTpStatsITCheckData(t *testing.T) {
|
||||
utils.ToJSON(tpStats[0]), utils.ToJSON(result[0]))
|
||||
}
|
||||
result, err = tpStatsMigrator.storDBIn.StorDB().GetTPStats(
|
||||
tpStats[0].TPid, tpStats[0].ID)
|
||||
tpStats[0].TPid, "", tpStats[0].ID)
|
||||
if err != utils.ErrNotFound {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ func testTpTresITMove(t *testing.T) {
|
||||
|
||||
func testTpTresITCheckData(t *testing.T) {
|
||||
result, err := tpTresMigrator.storDBOut.StorDB().GetTPThresholds(
|
||||
tpThresholds[0].TPid, tpThresholds[0].ID)
|
||||
tpThresholds[0].TPid, "", tpThresholds[0].ID)
|
||||
if err != nil {
|
||||
t.Error("Error when getting TpThresholds ", err.Error())
|
||||
}
|
||||
@@ -155,7 +155,7 @@ func testTpTresITCheckData(t *testing.T) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(tpThresholds[0]), utils.ToJSON(result[0]))
|
||||
}
|
||||
result, err = tpTresMigrator.storDBIn.StorDB().GetTPThresholds(
|
||||
tpThresholds[0].TPid, tpThresholds[0].ID)
|
||||
tpThresholds[0].TPid, "", tpThresholds[0].ID)
|
||||
if err != utils.ErrNotFound {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user