photoprism/internal/workers/prism_test.go
Michael Mayer 0b1bcf0d4a Replace TiDB with SQLite for improved stability #66
As a side effect, we need less configuration values.

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-30 14:52:47 +02:00

37 lines
650 B
Go

package workers
import (
"testing"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/internal/mutex"
"github.com/stretchr/testify/assert"
)
func TestPrism_Start(t *testing.T) {
conf := config.TestConfig()
t.Logf("database-dsn: %s", conf.DatabaseDsn())
worker := NewPrism(conf)
assert.IsType(t, &Prism{}, worker)
if err := mutex.PrismWorker.Start(); err != nil {
t.Fatal(err)
}
if err := worker.Start(); err == nil {
t.Fatal("error expected")
}
mutex.PrismWorker.Stop()
if err := worker.Start(); err != nil {
t.Fatal(err)
}
if err := worker.Start(); err != nil {
t.Fatal(err)
}
}