Commands: Refactor "show config-options" and "show config-yaml" tests

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-07-01 08:58:39 +02:00
parent 3005d83baf
commit d25b555dbc
6 changed files with 61 additions and 7 deletions

View File

@@ -3,15 +3,19 @@ package commands
import (
"testing"
"github.com/photoprism/photoprism/pkg/capture"
"github.com/stretchr/testify/assert"
)
func TestShowConfigOptionsCommand(t *testing.T) {
var err error
ctx := NewTestContext([]string{})
ctx := NewTestContext([]string{"config-options", "--md"})
err = ShowConfigOptionsCommand.Run(ctx)
output := capture.Stdout(func() {
err = ShowConfigOptionsCommand.Run(ctx)
})
assert.NoError(t, err)
assert.Contains(t, output, "PHOTOPRISM_IMPORT_PATH")
}