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

This commit is contained in:
2025-12-03 00:20:11 +01:00
parent 6c0a8bca64
commit 386f11ec7e
9 changed files with 138 additions and 34 deletions

View File

@@ -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}
}

View File

@@ -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.")
}
})