photoprism/internal/query/errors_test.go

33 lines
581 B
Go
Raw Normal View History

package query
import (
"testing"
2020-11-21 18:08:41 +01:00
"github.com/stretchr/testify/assert"
)
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) {
errors, err := Errors(1000, 0, "error")
if err != nil {
t.Fatal(err)
}
assert.Empty(t, errors)
})
t.Run("warning", func(t *testing.T) {
errors, err := Errors(1000, 0, "warning")
if err != nil {
t.Fatal(err)
}
assert.Empty(t, errors)
})
}