diff --git a/console/balance.go b/console/balance.go index de1a09bb7..facd8215c 100644 --- a/console/balance.go +++ b/console/balance.go @@ -36,7 +36,7 @@ type CmdGetBalance struct { // name should be exec's name func (self *CmdGetBalance) Usage(name string) string { - return fmt.Sprintf("\n\tUsage: %s [cfg_opts...{-h}] get_balance [ []]") + return fmt.Sprintf("\n\tUsage: cgr-console [cfg_opts...{-h}] get_balance [ []]") } // set param defaults diff --git a/console/command.go b/console/command.go index 01dfe4460..9f1cfe491 100644 --- a/console/command.go +++ b/console/command.go @@ -1,8 +1,7 @@ package console import ( - "fmt" - "path/filepath" + "errors" ) var ( @@ -22,11 +21,11 @@ type Commander interface { // Process args and return right command Value or error func GetCommandValue(args []string) (Commander, error) { if len(args) < 2 { - return nil, fmt.Errorf("\n\tUsage: %s [cfg_opts...{-h}] \n", filepath.Base(args[0])) + return nil, errors.New("\n\tUsage: cgr-console [cfg_opts...{-h}] \n") } cmdVal, exists := commands[args[1]] if !exists { - return nil, fmt.Errorf("\n\tUsage: %s [cfg_opts...{-h}] \n", filepath.Base(args[0])) + return nil, errors.New("\n\tUsage: cgr-console [cfg_opts...{-h}] \n") } if err := cmdVal.FromArgs(args); err != nil { return nil, err diff --git a/importer.go b/importer.go index 504a9dd57..fc99c0f90 100644 --- a/importer.go +++ b/importer.go @@ -22,10 +22,4 @@ import ( _ "github.com/cgrates/cgrates/cmd/cgr-console" _ "github.com/cgrates/cgrates/cmd/cgr-loader" _ "github.com/cgrates/cgrates/cmd/cgr-rater" - "github.com/cgrates/cgrates/timespans" ) - -func main(){ - cd := timespans.CallDesc{} - -} diff --git a/timespans/actions_test.go b/timespans/actions_test.go index c86e6b016..1fb28f9af 100644 --- a/timespans/actions_test.go +++ b/timespans/actions_test.go @@ -392,14 +392,16 @@ func TestActionTimingLogFunction(t *testing.T) { } } -func TestActionTimingPriotityList(t *testing.T) { +func TestActionTimingPriotityListSortByWeight(t *testing.T) { at1 := &ActionTiming{Timing: &Interval{ + Years: Years{2100}, Months: Months{time.January, time.February, time.March, time.April, time.May, time.June, time.July, time.August, time.September, time.October, time.November, time.December}, MonthDays: MonthDays{1}, StartTime: "00:00:00", Weight: 20, }} at2 := &ActionTiming{Timing: &Interval{ + Years: Years{2100}, Months: Months{time.January, time.February, time.March, time.April, time.May, time.June, time.July, time.August, time.September, time.October, time.November, time.December}, MonthDays: MonthDays{2}, StartTime: "00:00:00", @@ -409,7 +411,7 @@ func TestActionTimingPriotityList(t *testing.T) { atpl = append(atpl, at2, at1) atpl.Sort() if atpl[0] != at1 || atpl[1] != at2 { - t.Error("Timing list not sorted correctly: ", atpl) + t.Error("Timing list not sorted correctly: ", at1, at2, atpl) } }