Updated Tests for Guardian from DispatcherSv1

This commit is contained in:
Tripon Alexandru-Ionut
2019-03-27 16:22:30 +02:00
committed by Dan Christian Bogos
parent 5eb57ed8b1
commit 27b7742ac3

View File

@@ -30,6 +30,7 @@ import (
var sTestsDspGrd = []func(t *testing.T){
testDspGrdPing,
testDspGrdLock,
}
//Test start here
@@ -37,10 +38,6 @@ func TestDspGuardianSTMySQL(t *testing.T) {
testDsp(t, sTestsDspGrd, "TestDspGuardianS", "all", "all2", "attributes", "dispatchers", "tutorial", "oldtutorial", "dispatchers")
}
func TestDspGuardianSMongo(t *testing.T) {
testDsp(t, sTestsDspGrd, "TestDspGuardianS", "all", "all2", "attributes_mongo", "dispatchers_mongo", "tutorial", "oldtutorial", "dispatchers")
}
func testDspGrdPing(t *testing.T) {
var reply string
if err := allEngine.RCP.Call(utils.GuardianSv1Ping, new(utils.CGREvent), &reply); err != nil {
@@ -80,8 +77,6 @@ func testDspGrdLock(t *testing.T) {
},
}, &reply); err != nil {
t.Error(err)
} else if reply != utils.Pong {
t.Errorf("Received: %s", reply)
}
var unlockReply []string
@@ -95,10 +90,7 @@ func testDspGrdLock(t *testing.T) {
},
}, &unlockReply); err != nil {
t.Error(err)
} else if reply != utils.Pong {
t.Errorf("Received: %s", reply)
}
if !reflect.DeepEqual(args.LockIDs, unlockReply) {
} else if !reflect.DeepEqual(args.LockIDs, unlockReply) {
t.Errorf("Expected: %s , received: %s", utils.ToJSON(args.LockIDs), utils.ToJSON(unlockReply))
}
}