mirror of
https://github.com/ceph/go-ceph
synced 2024-12-20 05:11:29 +00:00
1f4543e835
Signed-off-by: John Mulligan <jmulligan@redhat.com>
21 lines
404 B
Go
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")
|
|
}
|