713593da4e
You can now run "photoprism auth add" to create new client access tokens that allow external applications to use the built-in REST API. Signed-off-by: Michael Mayer <michael@photoprism.app>
35 lines
941 B
Go
35 lines
941 B
Go
package entity
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestFaceMap_Get(t *testing.T) {
|
|
t.Run("get existing face", func(t *testing.T) {
|
|
r := FaceFixtures.Get("jane-doe")
|
|
assert.Equal(t, "js6sg6b1h1njaaab", r.SubjUID)
|
|
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, "js6sg6b1h1njaaab", r.SubjUID)
|
|
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)
|
|
})
|
|
}
|