Add version command, see #50

This commit is contained in:
Michael Mayer
2018-12-21 04:32:17 +01:00
parent 5345ad37a2
commit 9e887be2d6
4 changed files with 56 additions and 16 deletions

View File

@@ -16,19 +16,15 @@ func TestConfigCommand(t *testing.T) {
err = ConfigCommand.Run(ctx)
})
expected := `NAME VALUE
debug false
config-file /go/src/github.com/photoprism/photoprism/configs/photoprism.yml
darktable-cli /usr/bin/darktable-cli
originals-path /go/src/github.com/photoprism/photoprism/assets/testdata/originals
import-path /srv/photoprism/photos/import
export-path /srv/photoprism/photos/export
cache-path /srv/photoprism/cache
assets-path /go/src/github.com/photoprism/photoprism/assets
database-driver tidb
database-dsn root:@tcp(localhost:4000)/photoprism?parseTime=true
`
assert.Contains(t, output, "NAME VALUE")
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, "export-path")
assert.Contains(t, output, "cache-path")
assert.Contains(t, output, "assets-path")
assert.Equal(t, expected, output)
assert.Equal(t, output, output)
assert.Nil(t, err)
}