github.com/grafana/pyroscope@v1.18.0/pkg/test/mocks/mockclient/mock_repository_service.go (about)

     1  // Code generated by mockery. DO NOT EDIT.
     2  
     3  package mockclient
     4  
     5  import (
     6  	context "context"
     7  
     8  	github "github.com/google/go-github/v58/github"
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // MockrepositoryService is an autogenerated mock type for the repositoryService type
    13  type MockrepositoryService struct {
    14  	mock.Mock
    15  }
    16  
    17  type MockrepositoryService_Expecter struct {
    18  	mock *mock.Mock
    19  }
    20  
    21  func (_m *MockrepositoryService) EXPECT() *MockrepositoryService_Expecter {
    22  	return &MockrepositoryService_Expecter{mock: &_m.Mock}
    23  }
    24  
    25  // GetCommit provides a mock function with given fields: ctx, owner, repo, ref, opts
    26  func (_m *MockrepositoryService) GetCommit(ctx context.Context, owner string, repo string, ref string, opts *github.ListOptions) (*github.RepositoryCommit, *github.Response, error) {
    27  	ret := _m.Called(ctx, owner, repo, ref, opts)
    28  
    29  	if len(ret) == 0 {
    30  		panic("no return value specified for GetCommit")
    31  	}
    32  
    33  	var r0 *github.RepositoryCommit
    34  	var r1 *github.Response
    35  	var r2 error
    36  	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *github.ListOptions) (*github.RepositoryCommit, *github.Response, error)); ok {
    37  		return rf(ctx, owner, repo, ref, opts)
    38  	}
    39  	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *github.ListOptions) *github.RepositoryCommit); ok {
    40  		r0 = rf(ctx, owner, repo, ref, opts)
    41  	} else {
    42  		if ret.Get(0) != nil {
    43  			r0 = ret.Get(0).(*github.RepositoryCommit)
    44  		}
    45  	}
    46  
    47  	if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *github.ListOptions) *github.Response); ok {
    48  		r1 = rf(ctx, owner, repo, ref, opts)
    49  	} else {
    50  		if ret.Get(1) != nil {
    51  			r1 = ret.Get(1).(*github.Response)
    52  		}
    53  	}
    54  
    55  	if rf, ok := ret.Get(2).(func(context.Context, string, string, string, *github.ListOptions) error); ok {
    56  		r2 = rf(ctx, owner, repo, ref, opts)
    57  	} else {
    58  		r2 = ret.Error(2)
    59  	}
    60  
    61  	return r0, r1, r2
    62  }
    63  
    64  // MockrepositoryService_GetCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCommit'
    65  type MockrepositoryService_GetCommit_Call struct {
    66  	*mock.Call
    67  }
    68  
    69  // GetCommit is a helper method to define mock.On call
    70  //   - ctx context.Context
    71  //   - owner string
    72  //   - repo string
    73  //   - ref string
    74  //   - opts *github.ListOptions
    75  func (_e *MockrepositoryService_Expecter) GetCommit(ctx interface{}, owner interface{}, repo interface{}, ref interface{}, opts interface{}) *MockrepositoryService_GetCommit_Call {
    76  	return &MockrepositoryService_GetCommit_Call{Call: _e.mock.On("GetCommit", ctx, owner, repo, ref, opts)}
    77  }
    78  
    79  func (_c *MockrepositoryService_GetCommit_Call) Run(run func(ctx context.Context, owner string, repo string, ref string, opts *github.ListOptions)) *MockrepositoryService_GetCommit_Call {
    80  	_c.Call.Run(func(args mock.Arguments) {
    81  		run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(*github.ListOptions))
    82  	})
    83  	return _c
    84  }
    85  
    86  func (_c *MockrepositoryService_GetCommit_Call) Return(_a0 *github.RepositoryCommit, _a1 *github.Response, _a2 error) *MockrepositoryService_GetCommit_Call {
    87  	_c.Call.Return(_a0, _a1, _a2)
    88  	return _c
    89  }
    90  
    91  func (_c *MockrepositoryService_GetCommit_Call) RunAndReturn(run func(context.Context, string, string, string, *github.ListOptions) (*github.RepositoryCommit, *github.Response, error)) *MockrepositoryService_GetCommit_Call {
    92  	_c.Call.Return(run)
    93  	return _c
    94  }
    95  
    96  // GetContents provides a mock function with given fields: ctx, owner, repo, path, opts
    97  func (_m *MockrepositoryService) GetContents(ctx context.Context, owner string, repo string, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) {
    98  	ret := _m.Called(ctx, owner, repo, path, opts)
    99  
   100  	if len(ret) == 0 {
   101  		panic("no return value specified for GetContents")
   102  	}
   103  
   104  	var r0 *github.RepositoryContent
   105  	var r1 []*github.RepositoryContent
   106  	var r2 *github.Response
   107  	var r3 error
   108  	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)); ok {
   109  		return rf(ctx, owner, repo, path, opts)
   110  	}
   111  	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *github.RepositoryContentGetOptions) *github.RepositoryContent); ok {
   112  		r0 = rf(ctx, owner, repo, path, opts)
   113  	} else {
   114  		if ret.Get(0) != nil {
   115  			r0 = ret.Get(0).(*github.RepositoryContent)
   116  		}
   117  	}
   118  
   119  	if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *github.RepositoryContentGetOptions) []*github.RepositoryContent); ok {
   120  		r1 = rf(ctx, owner, repo, path, opts)
   121  	} else {
   122  		if ret.Get(1) != nil {
   123  			r1 = ret.Get(1).([]*github.RepositoryContent)
   124  		}
   125  	}
   126  
   127  	if rf, ok := ret.Get(2).(func(context.Context, string, string, string, *github.RepositoryContentGetOptions) *github.Response); ok {
   128  		r2 = rf(ctx, owner, repo, path, opts)
   129  	} else {
   130  		if ret.Get(2) != nil {
   131  			r2 = ret.Get(2).(*github.Response)
   132  		}
   133  	}
   134  
   135  	if rf, ok := ret.Get(3).(func(context.Context, string, string, string, *github.RepositoryContentGetOptions) error); ok {
   136  		r3 = rf(ctx, owner, repo, path, opts)
   137  	} else {
   138  		r3 = ret.Error(3)
   139  	}
   140  
   141  	return r0, r1, r2, r3
   142  }
   143  
   144  // MockrepositoryService_GetContents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContents'
   145  type MockrepositoryService_GetContents_Call struct {
   146  	*mock.Call
   147  }
   148  
   149  // GetContents is a helper method to define mock.On call
   150  //   - ctx context.Context
   151  //   - owner string
   152  //   - repo string
   153  //   - path string
   154  //   - opts *github.RepositoryContentGetOptions
   155  func (_e *MockrepositoryService_Expecter) GetContents(ctx interface{}, owner interface{}, repo interface{}, path interface{}, opts interface{}) *MockrepositoryService_GetContents_Call {
   156  	return &MockrepositoryService_GetContents_Call{Call: _e.mock.On("GetContents", ctx, owner, repo, path, opts)}
   157  }
   158  
   159  func (_c *MockrepositoryService_GetContents_Call) Run(run func(ctx context.Context, owner string, repo string, path string, opts *github.RepositoryContentGetOptions)) *MockrepositoryService_GetContents_Call {
   160  	_c.Call.Run(func(args mock.Arguments) {
   161  		run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(*github.RepositoryContentGetOptions))
   162  	})
   163  	return _c
   164  }
   165  
   166  func (_c *MockrepositoryService_GetContents_Call) Return(_a0 *github.RepositoryContent, _a1 []*github.RepositoryContent, _a2 *github.Response, _a3 error) *MockrepositoryService_GetContents_Call {
   167  	_c.Call.Return(_a0, _a1, _a2, _a3)
   168  	return _c
   169  }
   170  
   171  func (_c *MockrepositoryService_GetContents_Call) RunAndReturn(run func(context.Context, string, string, string, *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)) *MockrepositoryService_GetContents_Call {
   172  	_c.Call.Return(run)
   173  	return _c
   174  }
   175  
   176  // NewMockrepositoryService creates a new instance of MockrepositoryService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   177  // The first argument is typically a *testing.T value.
   178  func NewMockrepositoryService(t interface {
   179  	mock.TestingT
   180  	Cleanup(func())
   181  }) *MockrepositoryService {
   182  	mock := &MockrepositoryService{}
   183  	mock.Mock.Test(t)
   184  
   185  	t.Cleanup(func() { mock.AssertExpectations(t) })
   186  
   187  	return mock
   188  }