photoprism/internal/entity/face_fixtures_test.go

36 lines
947 B
Go
Raw Normal View History

2021-08-26 16:31:05 +02:00
package entity
import (
"testing"
2021-08-28 13:55:37 +02:00
"github.com/stretchr/testify/assert"
2021-08-26 16:31:05 +02:00
)
func TestFaceMap_Get(t *testing.T) {
t.Run("get existing face", func(t *testing.T) {
r := FaceFixtures.Get("jane-doe")
assert.Equal(t, "jqy1y111h1njaaab", r.SubjectUID)
assert.Equal(t, "VF7ANLDET2BKZNT4VQWJMMC6HBEFDOG7", r.ID)
assert.IsType(t, Face{}, r)
})
t.Run("get not existing location", func(t *testing.T) {
r := FaceFixtures.Get("xxx")
assert.Equal(t, UnknownID, r.ID)
assert.IsType(t, Face{}, r)
})
}
func TestFaceMap_Pointer(t *testing.T) {
t.Run("get existing face", func(t *testing.T) {
r := FaceFixtures.Pointer("jane-doe")
assert.Equal(t, "jqy1y111h1njaaab", r.SubjectUID)
assert.Equal(t, "VF7ANLDET2BKZNT4VQWJMMC6HBEFDOG7", r.ID)
assert.IsType(t, &Face{}, r)
})
t.Run("get not existing location", func(t *testing.T) {
r := FaceFixtures.Pointer("xxx")
assert.Equal(t, UnknownID, r.ID)
assert.IsType(t, &Face{}, r)
})
}