Tests: Add unit tests
This commit is contained in:
parent
e1364f288c
commit
0817f1876d
2 changed files with 52 additions and 0 deletions
26
internal/commands/show_thumb_sizes_test.go
Normal file
26
internal/commands/show_thumb_sizes_test.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"github.com/photoprism/photoprism/internal/config"
|
||||
"github.com/photoprism/photoprism/pkg/capture"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestShowThumbSizesCommand(t *testing.T) {
|
||||
var err error
|
||||
|
||||
ctx := config.CliTestContext()
|
||||
|
||||
output := capture.Output(func() {
|
||||
err = ShowThumbSizesCommand.Run(ctx)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Contains(t, output, "fit_2048")
|
||||
assert.Contains(t, output, "Mosaic View")
|
||||
assert.Contains(t, output, "Color Detection")
|
||||
}
|
26
internal/commands/show_video_sizes_test.go
Normal file
26
internal/commands/show_video_sizes_test.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"github.com/photoprism/photoprism/internal/config"
|
||||
"github.com/photoprism/photoprism/pkg/capture"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestShowVideoSizesCommand(t *testing.T) {
|
||||
var err error
|
||||
|
||||
ctx := config.CliTestContext()
|
||||
|
||||
output := capture.Output(func() {
|
||||
err = ShowVideoSizesCommand.Run(ctx)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Contains(t, output, "3840")
|
||||
assert.Contains(t, output, "7680")
|
||||
assert.Contains(t, output, "4K Ultra HD")
|
||||
}
|
Loading…
Reference in a new issue