mirror of
https://github.com/ceph/go-ceph
synced 2025-03-07 03:48:17 +00:00
revive v1.3.7 added https://github.com/mgechev/revive/pull/966 which checks for unused parameters in function literals. This caused several lint errors in go-ceph code. Signed-off-by: Manish <myathnal@redhat.com>
29 lines
787 B
Go
29 lines
787 B
Go
package admin
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func (suite *RadosGWTestSuite) TestQuota() {
|
|
suite.SetupConnection()
|
|
co, err := New(suite.endpoint, suite.accessKey, suite.secretKey, newDebugHTTPClient(http.DefaultClient))
|
|
assert.NoError(suite.T(), err)
|
|
|
|
suite.T().Run("set quota to user but user ID is empty", func(_ *testing.T) {
|
|
err := co.SetUserQuota(context.Background(), QuotaSpec{})
|
|
assert.Error(suite.T(), err)
|
|
assert.EqualError(suite.T(), err, errMissingUserID.Error())
|
|
})
|
|
|
|
suite.T().Run("get user quota but no user is specified", func(_ *testing.T) {
|
|
_, err := co.GetUserQuota(context.Background(), QuotaSpec{})
|
|
assert.Error(suite.T(), err)
|
|
assert.EqualError(suite.T(), err, errMissingUserID.Error())
|
|
|
|
})
|
|
}
|