photoprism/internal/query/errors_test.go

34 lines
611 B
Go
Raw Normal View History

package query
import (
"testing"
2020-11-21 18:08:41 +01:00
"github.com/stretchr/testify/assert"
)
// TODO test non empty case
func TestErrors(t *testing.T) {
2020-10-20 10:07:27 +02:00
t.Run("not existing", func(t *testing.T) {
errors, err := Errors(1000, 0, "notexistingErrorString")
if err != nil {
t.Fatal(err)
}
assert.Empty(t, errors)
})
t.Run("error", func(t *testing.T) {
2021-03-03 11:49:32 +01:00
errors, err := Errors(1000, 0, "errors")
2020-10-20 10:07:27 +02:00
if err != nil {
t.Fatal(err)
}
assert.Empty(t, errors)
})
t.Run("warning", func(t *testing.T) {
2021-03-03 11:49:32 +01:00
errors, err := Errors(1000, 0, "warnings")
2020-10-20 10:07:27 +02:00
if err != nil {
t.Fatal(err)
}
assert.Empty(t, errors)
})
}