frostfs-node/pkg/services/object/acl/v2/errors_test.go

30 lines
719 B
Go

package v2
import (
"errors"
"testing"
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
"github.com/stretchr/testify/require"
)
func TestBasicACLErr(t *testing.T) {
var reqInfo RequestInfo
err := basicACLErr(reqInfo)
var errAccessDenied *apistatus.ObjectAccessDenied
require.ErrorAs(t, err, &errAccessDenied,
"basicACLErr must be able to be casted to apistatus.ObjectAccessDenied")
}
func TestEACLErr(t *testing.T) {
var reqInfo RequestInfo
testErr := errors.New("test-eacl")
err := eACLErr(reqInfo, testErr)
var errAccessDenied *apistatus.ObjectAccessDenied
require.ErrorAs(t, err, &errAccessDenied,
"eACLErr must be able to be casted to apistatus.ObjectAccessDenied")
}