photoprism/internal/commands/show_test.go
Michael Mayer 82d61d1f93 File Types: Add experimental support for animated GIFs #590 #2207
Animated GIFs are transcoded to AVC because it is much smaller and
thus also suitable for long/large animations. In addition, this commit
adds support for more metadata fields such as frame rate, number of
frames, file capture timestamp (unix milliseconds), media type,
and software version. Support for SVG files can later be implemented in
a similar way.
2022-04-13 22:17:59 +02:00

74 lines
1.5 KiB
Go

package commands
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/pkg/capture"
)
func TestShowConfigCommand(t *testing.T) {
var err error
ctx := config.CliTestContext()
output := capture.Output(func() {
err = ShowConfigCommand.Run(ctx)
})
if err != nil {
t.Fatal(err)
}
// Expected config command output.
assert.Contains(t, output, "config-path")
assert.Contains(t, output, "originals-path")
assert.Contains(t, output, "import-path")
assert.Contains(t, output, "cache-path")
assert.Contains(t, output, "assets-path")
assert.Contains(t, output, "darktable-cli")
}
func TestShowFiltersCommand(t *testing.T) {
var err error
ctx := config.CliTestContext()
output := capture.Output(func() {
err = ShowFiltersCommand.Run(ctx)
})
if err != nil {
t.Fatal(err)
}
// Expected config command output.
assert.Contains(t, output, "landscape")
assert.Contains(t, output, "live")
assert.Contains(t, output, "Examples")
assert.Contains(t, output, "Filter")
assert.Contains(t, output, "Notes")
}
func TestShowFormatsCommand(t *testing.T) {
var err error
ctx := config.CliTestContext()
output := capture.Output(func() {
err = ShowFormatsCommand.Run(ctx)
})
if err != nil {
t.Fatal(err)
}
// Expected config command output.
assert.Contains(t, output, "JPEG")
assert.Contains(t, output, "MP4")
assert.Contains(t, output, "Image")
assert.Contains(t, output, "Format")
assert.Contains(t, output, "Description")
}