mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Tests: Refactor command tests
This commit is contained in:
@@ -3,22 +3,13 @@ package commands
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/photoprism/photoprism/pkg/capture"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestFindCommand(t *testing.T) {
|
||||
t.Run("All", func(t *testing.T) {
|
||||
var err error
|
||||
|
||||
// Create test context with flags and arguments.
|
||||
args := []string{"find", "--csv"}
|
||||
ctx := NewTestContext(args)
|
||||
|
||||
// Run command with test context.
|
||||
output := capture.Output(func() {
|
||||
err = FindCommand.Run(ctx, args...)
|
||||
})
|
||||
output, err := RunWithTestContext(FindCommand, []string{"find", "--csv"})
|
||||
|
||||
// Check command output for plausibility.
|
||||
//t.Logf(output)
|
||||
|
||||
Reference in New Issue
Block a user