photoprism/internal/test/config_test.go

26 lines
392 B
Go
Raw Normal View History

package test
import (
"testing"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
)
func TestNewConfig(t *testing.T) {
c := NewConfig()
assert.IsType(t, new(Config), c)
assert.Equal(t, AssetsPath, c.GetAssetsPath())
assert.False(t, c.IsDebug())
}
func TestConfig_ConnectToDatabase(t *testing.T) {
c := NewConfig()
2018-12-21 01:37:16 +00:00
db := c.Db()
assert.IsType(t, &gorm.DB{}, db)
}