photoprism/internal/entity/photo_quality_test.go

26 lines
911 B
Go
Raw Normal View History

2020-05-08 14:18:11 +02:00
package entity
import (
"testing"
2020-11-21 18:08:41 +01:00
"github.com/stretchr/testify/assert"
2020-05-08 14:18:11 +02:00
)
func TestPhoto_QualityScore(t *testing.T) {
t.Run("PhotoFixture19800101_000002_D640C559", func(t *testing.T) {
assert.Equal(t, 4, PhotoFixtures.Pointer("19800101_000002_D640C559").QualityScore())
2020-05-08 14:18:11 +02:00
})
t.Run("PhotoFixturePhoto01 - favorite true - taken at before 2008", func(t *testing.T) {
assert.Equal(t, 7, PhotoFixtures.Pointer("Photo01").QualityScore())
2020-05-08 14:18:11 +02:00
})
t.Run("PhotoFixturePhoto06 - taken at after 2012 - resolution 2", func(t *testing.T) {
assert.Equal(t, 4, PhotoFixtures.Pointer("Photo06").QualityScore())
2020-05-08 14:18:11 +02:00
})
t.Run("PhotoFixturePhoto07 - score < 3 bit edited", func(t *testing.T) {
assert.Equal(t, 3, PhotoFixtures.Pointer("Photo07").QualityScore())
2020-05-08 14:18:11 +02:00
})
2020-05-12 13:52:09 +02:00
t.Run("PhotoFixturePhoto15 - description with blacklist", func(t *testing.T) {
assert.Equal(t, 2, PhotoFixtures.Pointer("Photo15").QualityScore())
})
2020-05-08 14:18:11 +02:00
}