photoprism/internal/ttl/duration_test.go
Michael Mayer a287830d1f Videos: Allow setting a lower TTL for caching video content #3631
Adds the new "--http-video-maxage SECONDS" config option.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-08-15 11:06:43 +02:00

26 lines
527 B
Go

package ttl
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestDuration_Int(t *testing.T) {
t.Run("Hour", func(t *testing.T) {
assert.Equal(t, 3600, Duration(3600).Int())
})
t.Run("Month", func(t *testing.T) {
assert.Equal(t, 2592000, Duration(2592000).Int())
})
}
func TestDuration_String(t *testing.T) {
t.Run("Hour", func(t *testing.T) {
assert.Equal(t, "3600", Duration(3600).String())
})
t.Run("Month", func(t *testing.T) {
assert.Equal(t, "2592000", Duration(2592000).String())
})
}