Remove unnecessary dependency between tests

Deleted a helper function that was directly calling strings.Trim in
favor of using strings.Trim directly.
This commit is contained in:
ionutboangiu
2024-04-04 20:38:41 +03:00
committed by Dan Christian Bogos
parent 0d512f64c2
commit 821b5d05cc
2 changed files with 6 additions and 5 deletions

View File

@@ -28,7 +28,6 @@ import (
"reflect"
"slices"
"strconv"
"strings"
"testing"
"time"
@@ -63,9 +62,6 @@ var (
testActionsitremoteSetAccount,
testActionsitStopCgrEngine,
}
dbPath = func(dbType string) string {
return strings.Trim(dbType, "*")
}
)
func TestActionsit(t *testing.T) {

View File

@@ -2013,7 +2013,12 @@ func testStorDBitCRUDSMCosts2(t *testing.T) {
}
func testStorDBitFlush(t *testing.T) {
if err := storDB.Flush(path.Join(storDBCfg.DataFolderPath, "storage", dbPath(storDBCfg.StorDbCfg().Type))); err != nil {
dbScriptPath := path.Join(
storDBCfg.DataFolderPath,
"storage",
strings.Trim(storDBCfg.StorDbCfg().Type, "*"),
)
if err := storDB.Flush(dbScriptPath); err != nil {
t.Error(err)
}
}