2018-11-17 13:57:19 +01:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2021-09-22 19:33:41 +02:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
2019-05-06 23:18:10 +02:00
|
|
|
"github.com/photoprism/photoprism/internal/config"
|
2020-01-13 11:07:09 +01:00
|
|
|
"github.com/photoprism/photoprism/pkg/capture"
|
2018-11-17 13:57:19 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestConfigCommand(t *testing.T) {
|
|
|
|
var err error
|
|
|
|
|
2019-05-06 23:18:10 +02:00
|
|
|
ctx := config.CliTestContext()
|
2018-11-17 13:57:19 +01:00
|
|
|
|
2020-01-06 15:22:46 +01:00
|
|
|
output := capture.Output(func() {
|
2018-11-17 13:57:19 +01:00
|
|
|
err = ConfigCommand.Run(ctx)
|
|
|
|
})
|
|
|
|
|
2021-09-30 15:50:10 +02:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Expected config command output.
|
2020-05-05 15:42:54 +02:00
|
|
|
assert.Contains(t, output, "NAME VALUE")
|
2018-12-21 04:32:17 +01:00
|
|
|
assert.Contains(t, output, "config-file")
|
|
|
|
assert.Contains(t, output, "darktable-cli")
|
|
|
|
assert.Contains(t, output, "originals-path")
|
|
|
|
assert.Contains(t, output, "import-path")
|
|
|
|
assert.Contains(t, output, "cache-path")
|
|
|
|
assert.Contains(t, output, "assets-path")
|
2018-11-17 13:57:19 +01:00
|
|
|
}
|