2020-07-13 11:40:49 +02:00
|
|
|
package query
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2020-11-21 18:08:41 +01:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2020-07-13 11:40:49 +02:00
|
|
|
)
|
|
|
|
|
2021-03-03 11:49:32 +01:00
|
|
|
//TODO test non empty case
|
2020-07-13 11:40:49 +02:00
|
|
|
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)
|
|
|
|
})
|
|
|
|
|
2020-07-13 11:40:49 +02:00
|
|
|
}
|