go-ceph/rgw/admin/usage_test.go
Manish 6f90ce139c Code Lint: Fix lint errors caused by revive check for unused parameters
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>
2024-02-13 07:22:13 +00:00

29 lines
698 B
Go

package admin
import (
"context"
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func (suite *RadosGWTestSuite) TestUsage() {
suite.SetupConnection()
co, err := New(suite.endpoint, suite.accessKey, suite.secretKey, newDebugHTTPClient(http.DefaultClient))
assert.NoError(suite.T(), err)
suite.T().Run("get usage", func(t *testing.T) {
pTrue := true
usage, err := co.GetUsage(context.Background(), Usage{ShowSummary: &pTrue})
assert.NoError(suite.T(), err)
assert.NotEmpty(t, usage)
})
suite.T().Run("trim usage", func(_ *testing.T) {
pFalse := false
_, err := co.GetUsage(context.Background(), Usage{RemoveAll: &pFalse})
assert.NoError(suite.T(), err)
})
}