github.com/cloudreve/Cloudreve/v3@v3.0.0-20240224133659-3edb00a6484c/pkg/mocks/requestmock/request.go (about)

     1  package requestmock
     2  
     3  import (
     4  	"github.com/cloudreve/Cloudreve/v3/pkg/request"
     5  	"github.com/stretchr/testify/mock"
     6  	"io"
     7  )
     8  
     9  type RequestMock struct {
    10  	mock.Mock
    11  }
    12  
    13  func (r RequestMock) Request(method, target string, body io.Reader, opts ...request.Option) *request.Response {
    14  	return r.Called(method, target, body, opts).Get(0).(*request.Response)
    15  }