mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 08:38:45 +05:00
using time.Duration for rateincrements and groupinterval
This commit is contained in:
@@ -43,7 +43,7 @@ func TestSimpleMarshallerApStoreRestore(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSimpleMarshallerApRestoreFromString(t *testing.T) {
|
||||
s := "2012-02-01T14:30:01Z|;1,2,3,4,5,6,7,8,9,10,11,12;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31;1,2,3,4,5,6,0;00:00:00;;10;0;0:0.2:1;60;1;\n"
|
||||
s := "2012-02-01T14:30:01Z|;1,2,3,4,5,6,7,8,9,10,11,12;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31;1,2,3,4,5,6,0;00:00:00;;10;0;0:0.2:1s;60;1;\n"
|
||||
ap := &ActivationPeriod{}
|
||||
err := ap.Restore(s)
|
||||
if err != nil || len(ap.Intervals) != 1 {
|
||||
@@ -142,10 +142,10 @@ func TestIntervalStoreRestore(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntervalRestoreFromString(t *testing.T) {
|
||||
s := ";1,2,3,4,5,6,7,8,9,10,11,12;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31;1,2,3,4,5,6,0;00:00:00;;10;0;0:0.2:1;60;0;"
|
||||
s := ";1,2,3,4,5,6,7,8,9,10,11,12;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31;1,2,3,4,5,6,0;00:00:00;;10;0;0:0.2:1s;60;0;"
|
||||
i := Interval{}
|
||||
err := i.Restore(s)
|
||||
if err != nil || !i.Prices.Equal(PriceGroups{&Price{0, 0.2, 1}}) {
|
||||
if err != nil || !i.Prices.Equal(PriceGroups{&Price{0, 0.2, 1 * time.Second}}) {
|
||||
t.Errorf("Error restoring inteval period from string %+v", i)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user