photoprism/internal/service/service_test.go
Michael Mayer f0187df4a1 Purge command to remove missing files from the index #234
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-07 19:42:04 +02:00

65 lines
1.3 KiB
Go

package service
import (
"os"
"testing"
"github.com/photoprism/photoprism/internal/classify"
"github.com/photoprism/photoprism/internal/nsfw"
"github.com/photoprism/photoprism/internal/photoprism"
"github.com/photoprism/photoprism/internal/query"
"github.com/photoprism/photoprism/internal/session"
"github.com/stretchr/testify/assert"
"github.com/photoprism/photoprism/internal/config"
)
func TestMain(m *testing.M) {
c := config.TestConfig()
SetConfig(c)
code := m.Run()
os.Exit(code)
}
func TestConfig(t *testing.T) {
assert.Equal(t, conf, Config())
}
func TestClassify(t *testing.T) {
assert.IsType(t, &classify.TensorFlow{}, Classify())
}
func TestConvert(t *testing.T) {
assert.IsType(t, &photoprism.Convert{}, Convert())
}
func TestImport(t *testing.T) {
assert.IsType(t, &photoprism.Import{}, Import())
}
func TestIndex(t *testing.T) {
assert.IsType(t, &photoprism.Index{}, Index())
}
func TestPurge(t *testing.T) {
assert.IsType(t, &photoprism.Purge{}, Purge())
}
func TestNsfwDetector(t *testing.T) {
assert.IsType(t, &nsfw.Detector{}, NsfwDetector())
}
func TestQuery(t *testing.T) {
assert.IsType(t, &query.Query{}, Query())
}
func TestResample(t *testing.T) {
assert.IsType(t, &photoprism.Resample{}, Resample())
}
func TestSession(t *testing.T) {
assert.IsType(t, &session.Session{}, Session())
}