40 lines
698 B
Go
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))
|
|
}
|