photoprism/internal/config/config_test.go
2019-05-06 23:18:10 +02:00

24 lines
458 B
Go

package config
import (
"testing"
"github.com/photoprism/photoprism/internal/util"
"github.com/stretchr/testify/assert"
)
func TestNewConfig(t *testing.T) {
ctx := CliTestContext()
assert.True(t, ctx.IsSet("assets-path"))
assert.False(t, ctx.Bool("debug"))
c := NewConfig(ctx)
assert.IsType(t, new(Config), c)
assert.Equal(t, util.ExpandedFilename("../../assets"), c.AssetsPath())
assert.False(t, c.Debug())
assert.False(t, c.ReadOnly())
}