photoprism/pkg/fs/file_exts_test.go
Michael Mayer 92e6c4fe1e Download: Add Disabled, Originals, MediaRaw & MediaSidecar Flags #2234
Extends DownloadSettings with 4 additional options:
- Name: File name pattern for downloaded files (existed)
- Disabled: Disables downloads
- Originals: Only download files stored in "originals" folder
- MediaRaw: Include RAW image files
- MediaSidecar: Include metadata sidecar files (JSON, XMP, YAML)
2022-04-15 09:42:07 +02:00

31 lines
788 B
Go

package fs
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestFileExtensions_Known(t *testing.T) {
t.Run("Empty", func(t *testing.T) {
assert.False(t, Extensions.Known(""))
})
t.Run("jpg", func(t *testing.T) {
assert.True(t, Extensions.Known("testdata/test.jpg"))
})
t.Run("jpeg", func(t *testing.T) {
assert.True(t, Extensions.Known("testdata/test.jpeg"))
})
t.Run("cr2", func(t *testing.T) {
assert.True(t, Extensions.Known("testdata/.xxx/test (jpg).cr2"))
})
t.Run("CR2", func(t *testing.T) {
assert.True(t, Extensions.Known("testdata/test (jpg).CR2"))
})
t.Run("CR5", func(t *testing.T) {
assert.False(t, Extensions.Known("testdata/test (jpg).CR5"))
})
t.Run("mp", func(t *testing.T) {
assert.True(t, Extensions.Known("file.mp"))
})
}