Cover functions in utils/librates.go

This commit is contained in:
ionutboangiu
2021-03-10 18:43:59 +02:00
committed by Dan Christian Bogos
parent 3b4958c4bb
commit f36b543df3
2 changed files with 81 additions and 3 deletions

View File

@@ -1710,10 +1710,11 @@ func TestCoreUtilsGenerateDBItemOpts(t *testing.T) {
expected := map[string]interface{}{
OptsAPIKey: apiKey,
OptsRouteID: routeID,
CacheOpt: cache + ".",
CacheOpt: cache,
RemoteHostOpt: rmtHost,
}
received := GenerateDBItemOpts(apiKey, routeID, cache, rmtHost)
if len(received) != len(expected) {
t.Fatalf("The maps differ in length")
}
@@ -1722,6 +1723,4 @@ func TestCoreUtilsGenerateDBItemOpts(t *testing.T) {
t.Errorf("\nReceived: <%+v>, \nExpected: <%+v>", value, expected[key])
}
}
fmt.Println(received)
}