mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated unit tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
2e755bccb6
commit
077d916a1d
@@ -4947,7 +4947,7 @@ func TestV1GetConfigAsJSONRals(t *testing.T) {
|
||||
|
||||
func TestV1GetConfigAsJSONScheduler(t *testing.T) {
|
||||
var reply string
|
||||
expected := `{"schedulers":{"cdrs_conns":[],"enabled":false,"filters":[]}}`
|
||||
expected := `{"schedulers":{"cdrs_conns":[],"enabled":false,"filters":[],"thresholds_conns":[]}}`
|
||||
if cfgCgr, err := NewDefaultCGRConfig(); err != nil {
|
||||
t.Error(err)
|
||||
} else if err := cfgCgr.V1GetConfigAsJSON(&SectionWithOpts{Section: SCHEDULER_JSN}, &reply); err != nil {
|
||||
@@ -4959,7 +4959,7 @@ func TestV1GetConfigAsJSONScheduler(t *testing.T) {
|
||||
|
||||
func TestV1GetConfigAsJSONCdrs(t *testing.T) {
|
||||
var reply string
|
||||
expected := `{"schedulers":{"cdrs_conns":[],"enabled":false,"filters":[]}}`
|
||||
expected := `{"schedulers":{"cdrs_conns":[],"enabled":false,"filters":[],"thresholds_conns":[]}}`
|
||||
if cfgCgr, err := NewDefaultCGRConfig(); err != nil {
|
||||
t.Error(err)
|
||||
} else if err := cfgCgr.V1GetConfigAsJSON(&SectionWithOpts{Section: SCHEDULER_JSN}, &reply); err != nil {
|
||||
@@ -5053,13 +5053,6 @@ func TestV1GetConfigAsJSONDNSAgent(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewCGRConfigFromPathError(t *testing.T) {
|
||||
expected := "file </usr/share/cgrates/conf/samples/multifiles/d.json>:NOT_FOUND:ENV_VAR:LOGGER"
|
||||
if _, err := NewCGRConfigFromPath("/usr/share/cgrates/conf/samples/multifiles"); err == nil || err.Error() != expected {
|
||||
t.Errorf("Expected %+v, received %+v", expected, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCgrCdfEventReader(t *testing.T) {
|
||||
eCfg := &ERsCfg{
|
||||
Enabled: false,
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"net/rpc"
|
||||
"net/rpc/jsonrpc"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -73,7 +74,9 @@ func TestCapsStats(t *testing.T) {
|
||||
t.Errorf("Expected: %v ,received: %v", exp, cs)
|
||||
}
|
||||
<-exitChan
|
||||
exitChan = make(chan bool, 1)
|
||||
go func() {
|
||||
runtime.Gosched()
|
||||
time.Sleep(100)
|
||||
exitChan <- true
|
||||
}()
|
||||
@@ -87,6 +90,7 @@ func TestCapsStats(t *testing.T) {
|
||||
if pk := cs.GetPeak(); pk != 2 {
|
||||
t.Errorf("Expected the peak to be 2 received: %v", pk)
|
||||
}
|
||||
<-exitChan
|
||||
}
|
||||
|
||||
func TestCapsStatsGetAverage(t *testing.T) {
|
||||
|
||||
@@ -1378,7 +1378,6 @@ func testOnStorITCRUDHistory(t *testing.T) {
|
||||
|
||||
func testOnStorITCRUDStructVersion(t *testing.T) {
|
||||
if vrst, err := onStor.DataDB().GetVersions(utils.Accounts); err != utils.ErrNotFound {
|
||||
fmt.Println(vrst)
|
||||
t.Error(err)
|
||||
}
|
||||
vrs := Versions{
|
||||
|
||||
Reference in New Issue
Block a user