photoprism/internal/query/errors_test.go
Michael Mayer b072a18a17 Backend: Run "make fmt" with Go v1.19
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-08-10 16:09:21 +02:00

33 lines
611 B
Go

package query
import (
"testing"
"github.com/stretchr/testify/assert"
)
// TODO test non empty case
func TestErrors(t *testing.T) {
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) {
errors, err := Errors(1000, 0, "errors")
if err != nil {
t.Fatal(err)
}
assert.Empty(t, errors)
})
t.Run("warning", func(t *testing.T) {
errors, err := Errors(1000, 0, "warnings")
if err != nil {
t.Fatal(err)
}
assert.Empty(t, errors)
})
}