github.com/cs3org/reva/v2@v2.27.7/pkg/storage/utils/decomposedfs/tree/mocks/Blobstore.go (about)

     1  // Copyright 2018-2022 CERN
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  //
    15  // In applying this license, CERN does not waive the privileges and immunities
    16  // granted to it by virtue of its status as an Intergovernmental Organization
    17  // or submit itself to any jurisdiction.
    18  
    19  // Code generated by mockery v2.40.2. DO NOT EDIT.
    20  
    21  package mocks
    22  
    23  import (
    24  	io "io"
    25  
    26  	node "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node"
    27  	mock "github.com/stretchr/testify/mock"
    28  )
    29  
    30  // Blobstore is an autogenerated mock type for the Blobstore type
    31  type Blobstore struct {
    32  	mock.Mock
    33  }
    34  
    35  type Blobstore_Expecter struct {
    36  	mock *mock.Mock
    37  }
    38  
    39  func (_m *Blobstore) EXPECT() *Blobstore_Expecter {
    40  	return &Blobstore_Expecter{mock: &_m.Mock}
    41  }
    42  
    43  // Delete provides a mock function with given fields: _a0
    44  func (_m *Blobstore) Delete(_a0 *node.Node) error {
    45  	ret := _m.Called(_a0)
    46  
    47  	if len(ret) == 0 {
    48  		panic("no return value specified for Delete")
    49  	}
    50  
    51  	var r0 error
    52  	if rf, ok := ret.Get(0).(func(*node.Node) error); ok {
    53  		r0 = rf(_a0)
    54  	} else {
    55  		r0 = ret.Error(0)
    56  	}
    57  
    58  	return r0
    59  }
    60  
    61  // Blobstore_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
    62  type Blobstore_Delete_Call struct {
    63  	*mock.Call
    64  }
    65  
    66  // Delete is a helper method to define mock.On call
    67  //   - _a0 *node.Node
    68  func (_e *Blobstore_Expecter) Delete(_a0 interface{}) *Blobstore_Delete_Call {
    69  	return &Blobstore_Delete_Call{Call: _e.mock.On("Delete", _a0)}
    70  }
    71  
    72  func (_c *Blobstore_Delete_Call) Run(run func(_a0 *node.Node)) *Blobstore_Delete_Call {
    73  	_c.Call.Run(func(args mock.Arguments) {
    74  		run(args[0].(*node.Node))
    75  	})
    76  	return _c
    77  }
    78  
    79  func (_c *Blobstore_Delete_Call) Return(_a0 error) *Blobstore_Delete_Call {
    80  	_c.Call.Return(_a0)
    81  	return _c
    82  }
    83  
    84  func (_c *Blobstore_Delete_Call) RunAndReturn(run func(*node.Node) error) *Blobstore_Delete_Call {
    85  	_c.Call.Return(run)
    86  	return _c
    87  }
    88  
    89  // Download provides a mock function with given fields: _a0
    90  func (_m *Blobstore) Download(_a0 *node.Node) (io.ReadCloser, error) {
    91  	ret := _m.Called(_a0)
    92  
    93  	if len(ret) == 0 {
    94  		panic("no return value specified for Download")
    95  	}
    96  
    97  	var r0 io.ReadCloser
    98  	var r1 error
    99  	if rf, ok := ret.Get(0).(func(*node.Node) (io.ReadCloser, error)); ok {
   100  		return rf(_a0)
   101  	}
   102  	if rf, ok := ret.Get(0).(func(*node.Node) io.ReadCloser); ok {
   103  		r0 = rf(_a0)
   104  	} else {
   105  		if ret.Get(0) != nil {
   106  			r0 = ret.Get(0).(io.ReadCloser)
   107  		}
   108  	}
   109  
   110  	if rf, ok := ret.Get(1).(func(*node.Node) error); ok {
   111  		r1 = rf(_a0)
   112  	} else {
   113  		r1 = ret.Error(1)
   114  	}
   115  
   116  	return r0, r1
   117  }
   118  
   119  // Blobstore_Download_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Download'
   120  type Blobstore_Download_Call struct {
   121  	*mock.Call
   122  }
   123  
   124  // Download is a helper method to define mock.On call
   125  //   - _a0 *node.Node
   126  func (_e *Blobstore_Expecter) Download(_a0 interface{}) *Blobstore_Download_Call {
   127  	return &Blobstore_Download_Call{Call: _e.mock.On("Download", _a0)}
   128  }
   129  
   130  func (_c *Blobstore_Download_Call) Run(run func(_a0 *node.Node)) *Blobstore_Download_Call {
   131  	_c.Call.Run(func(args mock.Arguments) {
   132  		run(args[0].(*node.Node))
   133  	})
   134  	return _c
   135  }
   136  
   137  func (_c *Blobstore_Download_Call) Return(_a0 io.ReadCloser, _a1 error) *Blobstore_Download_Call {
   138  	_c.Call.Return(_a0, _a1)
   139  	return _c
   140  }
   141  
   142  func (_c *Blobstore_Download_Call) RunAndReturn(run func(*node.Node) (io.ReadCloser, error)) *Blobstore_Download_Call {
   143  	_c.Call.Return(run)
   144  	return _c
   145  }
   146  
   147  // Upload provides a mock function with given fields: _a0, source
   148  func (_m *Blobstore) Upload(_a0 *node.Node, source string) error {
   149  	ret := _m.Called(_a0, source)
   150  
   151  	if len(ret) == 0 {
   152  		panic("no return value specified for Upload")
   153  	}
   154  
   155  	var r0 error
   156  	if rf, ok := ret.Get(0).(func(*node.Node, string) error); ok {
   157  		r0 = rf(_a0, source)
   158  	} else {
   159  		r0 = ret.Error(0)
   160  	}
   161  
   162  	return r0
   163  }
   164  
   165  // Blobstore_Upload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upload'
   166  type Blobstore_Upload_Call struct {
   167  	*mock.Call
   168  }
   169  
   170  // Upload is a helper method to define mock.On call
   171  //   - _a0 *node.Node
   172  //   - source string
   173  func (_e *Blobstore_Expecter) Upload(_a0 interface{}, source interface{}) *Blobstore_Upload_Call {
   174  	return &Blobstore_Upload_Call{Call: _e.mock.On("Upload", _a0, source)}
   175  }
   176  
   177  func (_c *Blobstore_Upload_Call) Run(run func(_a0 *node.Node, source string)) *Blobstore_Upload_Call {
   178  	_c.Call.Run(func(args mock.Arguments) {
   179  		run(args[0].(*node.Node), args[1].(string))
   180  	})
   181  	return _c
   182  }
   183  
   184  func (_c *Blobstore_Upload_Call) Return(_a0 error) *Blobstore_Upload_Call {
   185  	_c.Call.Return(_a0)
   186  	return _c
   187  }
   188  
   189  func (_c *Blobstore_Upload_Call) RunAndReturn(run func(*node.Node, string) error) *Blobstore_Upload_Call {
   190  	_c.Call.Return(run)
   191  	return _c
   192  }
   193  
   194  // NewBlobstore creates a new instance of Blobstore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   195  // The first argument is typically a *testing.T value.
   196  func NewBlobstore(t interface {
   197  	mock.TestingT
   198  	Cleanup(func())
   199  }) *Blobstore {
   200  	mock := &Blobstore{}
   201  	mock.Mock.Test(t)
   202  
   203  	t.Cleanup(func() { mock.AssertExpectations(t) })
   204  
   205  	return mock
   206  }