photoprism/internal/query/file_sync_download_test.go

24 lines
456 B
Go
Raw Normal View History

2020-05-13 10:16:12 +02:00
package query
import (
"testing"
2020-11-21 18:08:41 +01:00
"github.com/stretchr/testify/assert"
2020-05-13 10:16:12 +02:00
)
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("filename empty", func(t *testing.T) {
err := SetDownloadFileID("", 1000000)
if err == nil {
t.Fatal()
}
assert.Equal(t, "sync: can't update, filename empty", err.Error())
})
}