go-ceph/rados/errors_test.go
John Mulligan 1f4543e835 rados: consolidate error types & values in an errors.go file
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-06 17:10:09 -04:00

21 lines
404 B
Go

package rados
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestRadosError(t *testing.T) {
err := getRadosError(0)
assert.NoError(t, err)
err = getRadosError(-5) // IO error
assert.Error(t, err)
assert.Equal(t, err.Error(), "rados: ret=5, Input/output error")
err = getRadosError(345) // no such errno
assert.Error(t, err)
assert.Equal(t, err.Error(), "rados: ret=345")
}