photoprism/internal/query/subjects_test.go
2021-08-24 14:27:34 +02:00

40 lines
698 B
Go

package query
import (
"testing"
"github.com/photoprism/photoprism/internal/entity"
"github.com/stretchr/testify/assert"
)
func TestSubjects(t *testing.T) {
results, err := Subjects(3, 0)
if err != nil {
t.Fatal(err)
}
assert.GreaterOrEqual(t, len(results), 1)
for _, val := range results {
assert.IsType(t, entity.Subject{}, val)
}
}
func TestRemoveDanglingMarkerSubjects(t *testing.T) {
affected, err := RemoveDanglingMarkerSubjects()
if err != nil {
t.Fatal(err)
}
assert.Equal(t, int64(1), affected)
}
func TestAddFaceMarkerSubjects(t *testing.T) {
affected, err := AddFaceMarkerSubjects()
assert.NoError(t, err)
assert.GreaterOrEqual(t, affected, int64(2))
}