mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
24 lines
456 B
Go
24 lines
456 B
Go
package query
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestSetDownloadFileID(t *testing.T) {
|
|
t.Run("Success", func(t *testing.T) {
|
|
err := SetDownloadFileID("exampleFileName.jpg", 1000000)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
})
|
|
t.Run("FilenameEmpty", func(t *testing.T) {
|
|
err := SetDownloadFileID("", 1000000)
|
|
if err == nil {
|
|
t.Fatal()
|
|
}
|
|
assert.Equal(t, "sync: cannot update, filename empty", err.Error())
|
|
})
|
|
}
|