github.com/argoproj/argo-cd/v3@v3.2.1/applicationset/services/mocks/Repos.go (about) 1 // Code generated by mockery; DO NOT EDIT. 2 // github.com/vektra/mockery 3 // template: testify 4 5 package mocks 6 7 import ( 8 "context" 9 10 mock "github.com/stretchr/testify/mock" 11 ) 12 13 // NewRepos creates a new instance of Repos. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 14 // The first argument is typically a *testing.T value. 15 func NewRepos(t interface { 16 mock.TestingT 17 Cleanup(func()) 18 }) *Repos { 19 mock := &Repos{} 20 mock.Mock.Test(t) 21 22 t.Cleanup(func() { mock.AssertExpectations(t) }) 23 24 return mock 25 } 26 27 // Repos is an autogenerated mock type for the Repos type 28 type Repos struct { 29 mock.Mock 30 } 31 32 type Repos_Expecter struct { 33 mock *mock.Mock 34 } 35 36 func (_m *Repos) EXPECT() *Repos_Expecter { 37 return &Repos_Expecter{mock: &_m.Mock} 38 } 39 40 // GetDirectories provides a mock function for the type Repos 41 func (_mock *Repos) GetDirectories(ctx context.Context, repoURL string, revision string, project string, noRevisionCache bool, verifyCommit bool) ([]string, error) { 42 ret := _mock.Called(ctx, repoURL, revision, project, noRevisionCache, verifyCommit) 43 44 if len(ret) == 0 { 45 panic("no return value specified for GetDirectories") 46 } 47 48 var r0 []string 49 var r1 error 50 if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, bool, bool) ([]string, error)); ok { 51 return returnFunc(ctx, repoURL, revision, project, noRevisionCache, verifyCommit) 52 } 53 if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, bool, bool) []string); ok { 54 r0 = returnFunc(ctx, repoURL, revision, project, noRevisionCache, verifyCommit) 55 } else { 56 if ret.Get(0) != nil { 57 r0 = ret.Get(0).([]string) 58 } 59 } 60 if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, string, bool, bool) error); ok { 61 r1 = returnFunc(ctx, repoURL, revision, project, noRevisionCache, verifyCommit) 62 } else { 63 r1 = ret.Error(1) 64 } 65 return r0, r1 66 } 67 68 // Repos_GetDirectories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDirectories' 69 type Repos_GetDirectories_Call struct { 70 *mock.Call 71 } 72 73 // GetDirectories is a helper method to define mock.On call 74 // - ctx context.Context 75 // - repoURL string 76 // - revision string 77 // - project string 78 // - noRevisionCache bool 79 // - verifyCommit bool 80 func (_e *Repos_Expecter) GetDirectories(ctx interface{}, repoURL interface{}, revision interface{}, project interface{}, noRevisionCache interface{}, verifyCommit interface{}) *Repos_GetDirectories_Call { 81 return &Repos_GetDirectories_Call{Call: _e.mock.On("GetDirectories", ctx, repoURL, revision, project, noRevisionCache, verifyCommit)} 82 } 83 84 func (_c *Repos_GetDirectories_Call) Run(run func(ctx context.Context, repoURL string, revision string, project string, noRevisionCache bool, verifyCommit bool)) *Repos_GetDirectories_Call { 85 _c.Call.Run(func(args mock.Arguments) { 86 var arg0 context.Context 87 if args[0] != nil { 88 arg0 = args[0].(context.Context) 89 } 90 var arg1 string 91 if args[1] != nil { 92 arg1 = args[1].(string) 93 } 94 var arg2 string 95 if args[2] != nil { 96 arg2 = args[2].(string) 97 } 98 var arg3 string 99 if args[3] != nil { 100 arg3 = args[3].(string) 101 } 102 var arg4 bool 103 if args[4] != nil { 104 arg4 = args[4].(bool) 105 } 106 var arg5 bool 107 if args[5] != nil { 108 arg5 = args[5].(bool) 109 } 110 run( 111 arg0, 112 arg1, 113 arg2, 114 arg3, 115 arg4, 116 arg5, 117 ) 118 }) 119 return _c 120 } 121 122 func (_c *Repos_GetDirectories_Call) Return(strings []string, err error) *Repos_GetDirectories_Call { 123 _c.Call.Return(strings, err) 124 return _c 125 } 126 127 func (_c *Repos_GetDirectories_Call) RunAndReturn(run func(ctx context.Context, repoURL string, revision string, project string, noRevisionCache bool, verifyCommit bool) ([]string, error)) *Repos_GetDirectories_Call { 128 _c.Call.Return(run) 129 return _c 130 } 131 132 // GetFiles provides a mock function for the type Repos 133 func (_mock *Repos) GetFiles(ctx context.Context, repoURL string, revision string, project string, pattern string, noRevisionCache bool, verifyCommit bool) (map[string][]byte, error) { 134 ret := _mock.Called(ctx, repoURL, revision, project, pattern, noRevisionCache, verifyCommit) 135 136 if len(ret) == 0 { 137 panic("no return value specified for GetFiles") 138 } 139 140 var r0 map[string][]byte 141 var r1 error 142 if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, string, bool, bool) (map[string][]byte, error)); ok { 143 return returnFunc(ctx, repoURL, revision, project, pattern, noRevisionCache, verifyCommit) 144 } 145 if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, string, bool, bool) map[string][]byte); ok { 146 r0 = returnFunc(ctx, repoURL, revision, project, pattern, noRevisionCache, verifyCommit) 147 } else { 148 if ret.Get(0) != nil { 149 r0 = ret.Get(0).(map[string][]byte) 150 } 151 } 152 if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, string, string, bool, bool) error); ok { 153 r1 = returnFunc(ctx, repoURL, revision, project, pattern, noRevisionCache, verifyCommit) 154 } else { 155 r1 = ret.Error(1) 156 } 157 return r0, r1 158 } 159 160 // Repos_GetFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFiles' 161 type Repos_GetFiles_Call struct { 162 *mock.Call 163 } 164 165 // GetFiles is a helper method to define mock.On call 166 // - ctx context.Context 167 // - repoURL string 168 // - revision string 169 // - project string 170 // - pattern string 171 // - noRevisionCache bool 172 // - verifyCommit bool 173 func (_e *Repos_Expecter) GetFiles(ctx interface{}, repoURL interface{}, revision interface{}, project interface{}, pattern interface{}, noRevisionCache interface{}, verifyCommit interface{}) *Repos_GetFiles_Call { 174 return &Repos_GetFiles_Call{Call: _e.mock.On("GetFiles", ctx, repoURL, revision, project, pattern, noRevisionCache, verifyCommit)} 175 } 176 177 func (_c *Repos_GetFiles_Call) Run(run func(ctx context.Context, repoURL string, revision string, project string, pattern string, noRevisionCache bool, verifyCommit bool)) *Repos_GetFiles_Call { 178 _c.Call.Run(func(args mock.Arguments) { 179 var arg0 context.Context 180 if args[0] != nil { 181 arg0 = args[0].(context.Context) 182 } 183 var arg1 string 184 if args[1] != nil { 185 arg1 = args[1].(string) 186 } 187 var arg2 string 188 if args[2] != nil { 189 arg2 = args[2].(string) 190 } 191 var arg3 string 192 if args[3] != nil { 193 arg3 = args[3].(string) 194 } 195 var arg4 string 196 if args[4] != nil { 197 arg4 = args[4].(string) 198 } 199 var arg5 bool 200 if args[5] != nil { 201 arg5 = args[5].(bool) 202 } 203 var arg6 bool 204 if args[6] != nil { 205 arg6 = args[6].(bool) 206 } 207 run( 208 arg0, 209 arg1, 210 arg2, 211 arg3, 212 arg4, 213 arg5, 214 arg6, 215 ) 216 }) 217 return _c 218 } 219 220 func (_c *Repos_GetFiles_Call) Return(stringToBytes map[string][]byte, err error) *Repos_GetFiles_Call { 221 _c.Call.Return(stringToBytes, err) 222 return _c 223 } 224 225 func (_c *Repos_GetFiles_Call) RunAndReturn(run func(ctx context.Context, repoURL string, revision string, project string, pattern string, noRevisionCache bool, verifyCommit bool) (map[string][]byte, error)) *Repos_GetFiles_Call { 226 _c.Call.Return(run) 227 return _c 228 }