photoprism/internal/entity/photo_label_test.go
Michael Mayer b31508e4f3 Refactor & improve editing of photo labels
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-04-19 01:13:55 +02:00

24 lines
577 B
Go

package entity
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewPhotoLabel(t *testing.T) {
t.Run("name Christmas 2018", func(t *testing.T) {
photoLabel := NewPhotoLabel(1, 3, 80, "source")
assert.Equal(t, uint(0x1), photoLabel.PhotoID)
assert.Equal(t, uint(0x3), photoLabel.LabelID)
assert.Equal(t, 80, photoLabel.Uncertainty)
assert.Equal(t, "source", photoLabel.LabelSrc)
})
}
func TestPhotoLabel_TableName(t *testing.T) {
photoLabel := &PhotoLabel{}
tableName := photoLabel.TableName()
assert.Equal(t, "photos_labels", tableName)
}