mirror of
https://github.com/photoprism/photoprism.git
synced 2025-10-30 03:41:57 +08:00
Tests: Add tests for internal/query
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
//TODO find duplicates
|
||||
func TestDuplicates(t *testing.T) {
|
||||
if files, err := Duplicates(10, 0, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if files == nil {
|
||||
t.Fatal("files must not be nil")
|
||||
}
|
||||
t.Run("success", func(t *testing.T) {
|
||||
if files, err := Duplicates(10, 0, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if files == nil {
|
||||
t.Fatal("files must not be nil")
|
||||
}
|
||||
})
|
||||
t.Run("pathname not empty", func(t *testing.T) {
|
||||
files, err := Duplicates(10, 0, "/holiday/sea.jpg")
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Empty(t, files)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user