mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 00:28:44 +05:00
Extending CDRC XML, adding HierarchyPath to configs
This commit is contained in:
@@ -20,6 +20,7 @@ package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
@@ -659,3 +660,21 @@ func TestEndOfMonth(t *testing.T) {
|
||||
t.Errorf("Expected %v was %v", expected, eom)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseHierarchyPath(t *testing.T) {
|
||||
eHP := HierarchyPath([]string{"Root", "CGRateS"})
|
||||
if hp := ParseHierarchyPath("Root>CGRateS", ""); !reflect.DeepEqual(hp, eHP) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", eHP, hp)
|
||||
}
|
||||
if hp := ParseHierarchyPath("/Root/CGRateS/", ""); !reflect.DeepEqual(hp, eHP) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", eHP, hp)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHierarchyPathAsString(t *testing.T) {
|
||||
eStr := "/Root/CGRateS"
|
||||
hp := HierarchyPath([]string{"Root", "CGRateS"})
|
||||
if hpStr := hp.AsString("/", true); hpStr != eStr {
|
||||
t.Errorf("Expecting: %q, received: %q", eStr, hpStr)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user