blob: 46384422a174d4e7d112ee811d97dbf5fd8c5547 [file] [log] [blame]
// Code generated by mockery v0.0.0-dev. DO NOT EDIT.
package mocks
import (
client "github.com/bazelbuild/remote-apis-sdks/go/pkg/client"
command "github.com/bazelbuild/remote-apis-sdks/go/pkg/command"
context "context"
digest "github.com/bazelbuild/remote-apis-sdks/go/pkg/digest"
filemetadata "github.com/bazelbuild/remote-apis-sdks/go/pkg/filemetadata"
mock "github.com/stretchr/testify/mock"
remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
uploadinfo "github.com/bazelbuild/remote-apis-sdks/go/pkg/uploadinfo"
)
// RBEClient is an autogenerated mock type for the RBEClient type
type RBEClient struct {
mock.Mock
}
// Close provides a mock function with given fields:
func (_m *RBEClient) Close() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Close")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// ComputeMerkleTree provides a mock function with given fields: ctx, execRoot, workingDir, remoteWorkingDir, is, cache
func (_m *RBEClient) ComputeMerkleTree(ctx context.Context, execRoot string, workingDir string, remoteWorkingDir string, is *command.InputSpec, cache filemetadata.Cache) (digest.Digest, []*uploadinfo.Entry, *client.TreeStats, error) {
ret := _m.Called(ctx, execRoot, workingDir, remoteWorkingDir, is, cache)
if len(ret) == 0 {
panic("no return value specified for ComputeMerkleTree")
}
var r0 digest.Digest
var r1 []*uploadinfo.Entry
var r2 *client.TreeStats
var r3 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *command.InputSpec, filemetadata.Cache) (digest.Digest, []*uploadinfo.Entry, *client.TreeStats, error)); ok {
return rf(ctx, execRoot, workingDir, remoteWorkingDir, is, cache)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *command.InputSpec, filemetadata.Cache) digest.Digest); ok {
r0 = rf(ctx, execRoot, workingDir, remoteWorkingDir, is, cache)
} else {
r0 = ret.Get(0).(digest.Digest)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *command.InputSpec, filemetadata.Cache) []*uploadinfo.Entry); ok {
r1 = rf(ctx, execRoot, workingDir, remoteWorkingDir, is, cache)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([]*uploadinfo.Entry)
}
}
if rf, ok := ret.Get(2).(func(context.Context, string, string, string, *command.InputSpec, filemetadata.Cache) *client.TreeStats); ok {
r2 = rf(ctx, execRoot, workingDir, remoteWorkingDir, is, cache)
} else {
if ret.Get(2) != nil {
r2 = ret.Get(2).(*client.TreeStats)
}
}
if rf, ok := ret.Get(3).(func(context.Context, string, string, string, *command.InputSpec, filemetadata.Cache) error); ok {
r3 = rf(ctx, execRoot, workingDir, remoteWorkingDir, is, cache)
} else {
r3 = ret.Error(3)
}
return r0, r1, r2, r3
}
// DownloadDirectory provides a mock function with given fields: ctx, d, execRoot, cache
func (_m *RBEClient) DownloadDirectory(ctx context.Context, d digest.Digest, execRoot string, cache filemetadata.Cache) (map[string]*client.TreeOutput, *client.MovedBytesMetadata, error) {
ret := _m.Called(ctx, d, execRoot, cache)
if len(ret) == 0 {
panic("no return value specified for DownloadDirectory")
}
var r0 map[string]*client.TreeOutput
var r1 *client.MovedBytesMetadata
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, digest.Digest, string, filemetadata.Cache) (map[string]*client.TreeOutput, *client.MovedBytesMetadata, error)); ok {
return rf(ctx, d, execRoot, cache)
}
if rf, ok := ret.Get(0).(func(context.Context, digest.Digest, string, filemetadata.Cache) map[string]*client.TreeOutput); ok {
r0 = rf(ctx, d, execRoot, cache)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]*client.TreeOutput)
}
}
if rf, ok := ret.Get(1).(func(context.Context, digest.Digest, string, filemetadata.Cache) *client.MovedBytesMetadata); ok {
r1 = rf(ctx, d, execRoot, cache)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*client.MovedBytesMetadata)
}
}
if rf, ok := ret.Get(2).(func(context.Context, digest.Digest, string, filemetadata.Cache) error); ok {
r2 = rf(ctx, d, execRoot, cache)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// GetDirectoryTree provides a mock function with given fields: ctx, d
func (_m *RBEClient) GetDirectoryTree(ctx context.Context, d *remoteexecution.Digest) ([]*remoteexecution.Directory, error) {
ret := _m.Called(ctx, d)
if len(ret) == 0 {
panic("no return value specified for GetDirectoryTree")
}
var r0 []*remoteexecution.Directory
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *remoteexecution.Digest) ([]*remoteexecution.Directory, error)); ok {
return rf(ctx, d)
}
if rf, ok := ret.Get(0).(func(context.Context, *remoteexecution.Digest) []*remoteexecution.Directory); ok {
r0 = rf(ctx, d)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*remoteexecution.Directory)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *remoteexecution.Digest) error); ok {
r1 = rf(ctx, d)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// UploadIfMissing provides a mock function with given fields: ctx, data
func (_m *RBEClient) UploadIfMissing(ctx context.Context, data ...*uploadinfo.Entry) ([]digest.Digest, int64, error) {
_va := make([]interface{}, len(data))
for _i := range data {
_va[_i] = data[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for UploadIfMissing")
}
var r0 []digest.Digest
var r1 int64
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, ...*uploadinfo.Entry) ([]digest.Digest, int64, error)); ok {
return rf(ctx, data...)
}
if rf, ok := ret.Get(0).(func(context.Context, ...*uploadinfo.Entry) []digest.Digest); ok {
r0 = rf(ctx, data...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]digest.Digest)
}
}
if rf, ok := ret.Get(1).(func(context.Context, ...*uploadinfo.Entry) int64); ok {
r1 = rf(ctx, data...)
} else {
r1 = ret.Get(1).(int64)
}
if rf, ok := ret.Get(2).(func(context.Context, ...*uploadinfo.Entry) error); ok {
r2 = rf(ctx, data...)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// NewRBEClient creates a new instance of RBEClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewRBEClient(t interface {
mock.TestingT
Cleanup(func())
}) *RBEClient {
mock := &RBEClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}