mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Add error handler for Mongo GetCDrs remove
This commit is contained in:
committed by
Dan Christian Bogos
parent
57d5c27f58
commit
f6a3af57dd
@@ -44,6 +44,7 @@ var sTestsCdrIT = []func(t *testing.T){
|
||||
testCdrITConnect,
|
||||
testCdrITFlush,
|
||||
testCdrITMigrateAndMove,
|
||||
testMongoGetCdrsRemoveErr,
|
||||
}
|
||||
|
||||
func TestCdrITMongo(t *testing.T) {
|
||||
@@ -188,3 +189,16 @@ func testCdrITMigrateAndMove(t *testing.T) {
|
||||
// t.Errorf("Expected 1, received: %v", cdrMigrator.stats[utils.CDRs])
|
||||
// }
|
||||
}
|
||||
|
||||
func testMongoGetCdrsRemoveErr(t *testing.T) {
|
||||
cdrMigrator.Close()
|
||||
|
||||
expErr := "client is disconnected"
|
||||
if cdrPathIn == "/usr/share/cgrates/conf/samples/tutmongo" {
|
||||
_, _, err := cdrMigrator.storDBOut.StorDB().GetCDRs(new(utils.CDRsFilter), true)
|
||||
if err == nil || err.Error() != expErr {
|
||||
t.Errorf("Expected error <%v>, Received <%v>", expErr, err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user