mirror of
https://github.com/ceph/go-ceph
synced 2024-12-12 01:16:24 +00:00
9cae71ab54
Instead of implementing our own logging let's the consumer implement their own potential debug for each HTTP requests. Closes: https://github.com/ceph/go-ceph/issues/508 Signed-off-by: Sébastien Han <seb@redhat.com>
29 lines
698 B
Go
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(t *testing.T) {
|
|
pFalse := false
|
|
_, err := co.GetUsage(context.Background(), Usage{RemoveAll: &pFalse})
|
|
assert.NoError(suite.T(), err)
|
|
})
|
|
}
|