photoprism/internal/config/config_metadata_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

43 lines
974 B
Go

package config
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestConfig_ExifBruteForce(t *testing.T) {
c := NewConfig(CliTestContext())
assert.Equal(t, false, c.ExifBruteForce())
}
func TestConfig_ExifToolBin(t *testing.T) {
c := NewConfig(CliTestContext())
bin := c.ExifToolBin()
assert.Equal(t, "/usr/bin/exiftool", bin)
}
func TestConfig_ExifToolJson(t *testing.T) {
c := NewConfig(CliTestContext())
assert.Equal(t, true, c.ExifToolJson())
assert.Equal(t, c.DisableExifTool(), !c.ExifToolJson())
c.options.DisableExifTool = true
assert.Equal(t, false, c.ExifToolJson())
assert.Equal(t, c.DisableExifTool(), !c.ExifToolJson())
}
func TestConfig_SidecarYaml(t *testing.T) {
c := NewConfig(CliTestContext())
assert.Equal(t, true, c.BackupYaml())
assert.Equal(t, c.DisableBackups(), !c.BackupYaml())
c.options.DisableBackups = true
assert.Equal(t, false, c.BackupYaml())
assert.Equal(t, c.DisableBackups(), !c.BackupYaml())
}