Tests in services

This commit is contained in:
andronache
2020-12-18 16:58:30 +02:00
committed by Dan Christian Bogos
parent 219cf8a199
commit 570e909aae
2 changed files with 12 additions and 1 deletions

View File

@@ -74,5 +74,16 @@ func TestCoreSCoverage(t *testing.T) {
if getCoreS == nil {
t.Errorf("\nExpecting not <nil>,\n Received <%+v>", getCoreS)
}
//populates connChan with something in order to call the shutdown function
chS := engine.NewCacheS(cfg, nil, nil)
srv.connChan <- chS
srv.stopChan = make(chan struct{})
getShut := srv.Shutdown()
if getShut != nil {
t.Errorf("\nExpecting not <nil>,\n Received <%+v>", getShut)
}
if srv.IsRunning() {
t.Errorf("Expected service to be down")
}
}

View File

@@ -56,7 +56,7 @@ func TestStorDBServiceCoverage(t *testing.T) {
Password: "test_pass",
}
err2 = srv.Reload()
if err2 != nil {
if err2 == nil {
t.Errorf("\nExpecting <Error 1045: Access denied for user 'cgrates'@'localhost' (using password: NO)>,\n Received <%+v>", err2)
}
}