fixed #63 all scheduled tasks are now under route /auto and will require api key in the future
Some checks failed
Tests / Run Go Tests (push) Failing after 1m32s
Some checks failed
Tests / Run Go Tests (push) Failing after 1m32s
This commit is contained in:
@@ -59,7 +59,7 @@ func (p *ParamsParser) ParseStringFallback(key string, fallback string) string {
|
||||
return p.urlParams.Get(key)
|
||||
}
|
||||
|
||||
func (p *ParamsParser) ParseString(key string, fallback string) (string, error) {
|
||||
func (p *ParamsParser) ParseString(key string) (string, error) {
|
||||
if !p.urlParams.Has(key) {
|
||||
return "", &NoValueError{Key: key}
|
||||
}
|
||||
|
||||
@@ -30,16 +30,18 @@ func TestFormatDuration(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
duration time.Duration
|
||||
fill bool
|
||||
}{
|
||||
{"2h", time.Duration(120 * time.Minute)},
|
||||
{"30min", time.Duration(30 * time.Minute)},
|
||||
{"1h 30min", time.Duration(90 * time.Minute)},
|
||||
{"-1h 30min", time.Duration(-90 * time.Minute)},
|
||||
{"0min", 0},
|
||||
{"2h", time.Duration(120 * time.Minute), true},
|
||||
{"30min", time.Duration(30 * time.Minute), true},
|
||||
{"1h 30min", time.Duration(90 * time.Minute), true},
|
||||
{"-1h 30min", time.Duration(-90 * time.Minute), true},
|
||||
{"0min", 0, true},
|
||||
{"", 0, false},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
if FormatDurationFill(tc.duration, true) != tc.name {
|
||||
if FormatDurationFill(tc.duration, tc.fill) != tc.name {
|
||||
t.Error("Format missmatch in Formatduration.")
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user