1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package logind
6
7import (
8 "context"
9
10 "github.com/godbus/dbus/v5"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// newMockbus creates a new instance of mockbus. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func newMockbus(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *mockbus {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &mockbus{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// mockbus is an autogenerated mock type for the bus type
38type mockbus struct {
39 mock.Mock
40}
41
42type mockbus_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *mockbus) EXPECT() *mockbus_Expecter {
47 return &mockbus_Expecter{mock: &_m.Mock}
48}
49
50// call provides a mock function for the type mockbus
51func (_mock *mockbus) call(context1 context.Context, s string, objectPath dbus.ObjectPath, s1 string, anyMoqParams ...any) ([]any, error) {
52 var tmpRet mock.Arguments
53 if len(anyMoqParams) > 0 {
54 tmpRet = _mock.Called(context1, s, objectPath, s1, anyMoqParams)
55 } else {
56 tmpRet = _mock.Called(context1, s, objectPath, s1)
57 }
58 ret := tmpRet
59
60 if len(ret) == 0 {
61 panic("no return value specified for call")
62 }
63
64 var r0 []any
65 var r1 error
66 if returnFunc, ok := ret.Get(0).(func(context.Context, string, dbus.ObjectPath, string, ...any) ([]any, error)); ok {
67 return returnFunc(context1, s, objectPath, s1, anyMoqParams...)
68 }
69 if returnFunc, ok := ret.Get(0).(func(context.Context, string, dbus.ObjectPath, string, ...any) []any); ok {
70 r0 = returnFunc(context1, s, objectPath, s1, anyMoqParams...)
71 } else {
72 if ret.Get(0) != nil {
73 r0 = ret.Get(0).([]any)
74 }
75 }
76 if returnFunc, ok := ret.Get(1).(func(context.Context, string, dbus.ObjectPath, string, ...any) error); ok {
77 r1 = returnFunc(context1, s, objectPath, s1, anyMoqParams...)
78 } else {
79 r1 = ret.Error(1)
80 }
81 return r0, r1
82}
83
84// mockbus_call_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'call'
85type mockbus_call_Call struct {
86 *mock.Call
87}
88
89// call is a helper method to define mock.On call
90// - context1 context.Context
91// - s string
92// - objectPath dbus.ObjectPath
93// - s1 string
94// - anyMoqParams ...any
95func (_e *mockbus_Expecter) call(context1 any, s any, objectPath any, s1 any, anyMoqParams ...any) *mockbus_call_Call {
96 return &mockbus_call_Call{Call: _e.mock.On("call",
97 append([]any{context1, s, objectPath, s1}, anyMoqParams...)...)}
98}
99
100func (_c *mockbus_call_Call) Run(run func(context1 context.Context, s string, objectPath dbus.ObjectPath, s1 string, anyMoqParams ...any)) *mockbus_call_Call {
101 _c.Call.Run(func(args mock.Arguments) {
102 var arg0 context.Context
103 if args[0] != nil {
104 arg0 = args[0].(context.Context)
105 }
106 var arg1 string
107 if args[1] != nil {
108 arg1 = args[1].(string)
109 }
110 var arg2 dbus.ObjectPath
111 if args[2] != nil {
112 arg2 = args[2].(dbus.ObjectPath)
113 }
114 var arg3 string
115 if args[3] != nil {
116 arg3 = args[3].(string)
117 }
118 var arg4 []any
119 var variadicArgs []any
120 if len(args) > 4 {
121 variadicArgs = args[4].([]any)
122 }
123 arg4 = variadicArgs
124 run(
125 arg0,
126 arg1,
127 arg2,
128 arg3,
129 arg4...,
130 )
131 })
132 return _c
133}
134
135func (_c *mockbus_call_Call) Return(anyMoqParams1 []any, err error) *mockbus_call_Call {
136 _c.Call.Return(anyMoqParams1, err)
137 return _c
138}
139
140func (_c *mockbus_call_Call) RunAndReturn(run func(context1 context.Context, s string, objectPath dbus.ObjectPath, s1 string, anyMoqParams ...any) ([]any, error)) *mockbus_call_Call {
141 _c.Call.Return(run)
142 return _c
143}
144
145// close provides a mock function for the type mockbus
146func (_mock *mockbus) close() error {
147 ret := _mock.Called()
148
149 if len(ret) == 0 {
150 panic("no return value specified for close")
151 }
152
153 var r0 error
154 if returnFunc, ok := ret.Get(0).(func() error); ok {
155 r0 = returnFunc()
156 } else {
157 r0 = ret.Error(0)
158 }
159 return r0
160}
161
162// mockbus_close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'close'
163type mockbus_close_Call struct {
164 *mock.Call
165}
166
167// close is a helper method to define mock.On call
168func (_e *mockbus_Expecter) close() *mockbus_close_Call {
169 return &mockbus_close_Call{Call: _e.mock.On("close")}
170}
171
172func (_c *mockbus_close_Call) Run(run func()) *mockbus_close_Call {
173 _c.Call.Run(func(args mock.Arguments) {
174 run()
175 })
176 return _c
177}
178
179func (_c *mockbus_close_Call) Return(err error) *mockbus_close_Call {
180 _c.Call.Return(err)
181 return _c
182}
183
184func (_c *mockbus_close_Call) RunAndReturn(run func() error) *mockbus_close_Call {
185 _c.Call.Return(run)
186 return _c
187}
188
189// match provides a mock function for the type mockbus
190func (_mock *mockbus) match(context1 context.Context, s string) error {
191 ret := _mock.Called(context1, s)
192
193 if len(ret) == 0 {
194 panic("no return value specified for match")
195 }
196
197 var r0 error
198 if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
199 r0 = returnFunc(context1, s)
200 } else {
201 r0 = ret.Error(0)
202 }
203 return r0
204}
205
206// mockbus_match_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'match'
207type mockbus_match_Call struct {
208 *mock.Call
209}
210
211// match is a helper method to define mock.On call
212// - context1 context.Context
213// - s string
214func (_e *mockbus_Expecter) match(context1 any, s any) *mockbus_match_Call {
215 return &mockbus_match_Call{Call: _e.mock.On("match", context1, s)}
216}
217
218func (_c *mockbus_match_Call) Run(run func(context1 context.Context, s string)) *mockbus_match_Call {
219 _c.Call.Run(func(args mock.Arguments) {
220 var arg0 context.Context
221 if args[0] != nil {
222 arg0 = args[0].(context.Context)
223 }
224 var arg1 string
225 if args[1] != nil {
226 arg1 = args[1].(string)
227 }
228 run(
229 arg0,
230 arg1,
231 )
232 })
233 return _c
234}
235
236func (_c *mockbus_match_Call) Return(err error) *mockbus_match_Call {
237 _c.Call.Return(err)
238 return _c
239}
240
241func (_c *mockbus_match_Call) RunAndReturn(run func(context1 context.Context, s string) error) *mockbus_match_Call {
242 _c.Call.Return(run)
243 return _c
244}
245
246// removeSignals provides a mock function for the type mockbus
247func (_mock *mockbus) removeSignals(signalCh chan<- *dbus.Signal) {
248 _mock.Called(signalCh)
249 return
250}
251
252// mockbus_removeSignals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'removeSignals'
253type mockbus_removeSignals_Call struct {
254 *mock.Call
255}
256
257// removeSignals is a helper method to define mock.On call
258// - signalCh chan<- *dbus.Signal
259func (_e *mockbus_Expecter) removeSignals(signalCh any) *mockbus_removeSignals_Call {
260 return &mockbus_removeSignals_Call{Call: _e.mock.On("removeSignals", signalCh)}
261}
262
263func (_c *mockbus_removeSignals_Call) Run(run func(signalCh chan<- *dbus.Signal)) *mockbus_removeSignals_Call {
264 _c.Call.Run(func(args mock.Arguments) {
265 var arg0 chan<- *dbus.Signal
266 if args[0] != nil {
267 arg0 = args[0].(chan<- *dbus.Signal)
268 }
269 run(
270 arg0,
271 )
272 })
273 return _c
274}
275
276func (_c *mockbus_removeSignals_Call) Return() *mockbus_removeSignals_Call {
277 _c.Call.Return()
278 return _c
279}
280
281func (_c *mockbus_removeSignals_Call) RunAndReturn(run func(signalCh chan<- *dbus.Signal)) *mockbus_removeSignals_Call {
282 _c.Run(run)
283 return _c
284}
285
286// signals provides a mock function for the type mockbus
287func (_mock *mockbus) signals(signalCh chan<- *dbus.Signal) {
288 _mock.Called(signalCh)
289 return
290}
291
292// mockbus_signals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'signals'
293type mockbus_signals_Call struct {
294 *mock.Call
295}
296
297// signals is a helper method to define mock.On call
298// - signalCh chan<- *dbus.Signal
299func (_e *mockbus_Expecter) signals(signalCh any) *mockbus_signals_Call {
300 return &mockbus_signals_Call{Call: _e.mock.On("signals", signalCh)}
301}
302
303func (_c *mockbus_signals_Call) Run(run func(signalCh chan<- *dbus.Signal)) *mockbus_signals_Call {
304 _c.Call.Run(func(args mock.Arguments) {
305 var arg0 chan<- *dbus.Signal
306 if args[0] != nil {
307 arg0 = args[0].(chan<- *dbus.Signal)
308 }
309 run(
310 arg0,
311 )
312 })
313 return _c
314}
315
316func (_c *mockbus_signals_Call) Return() *mockbus_signals_Call {
317 _c.Call.Return()
318 return _c
319}
320
321func (_c *mockbus_signals_Call) RunAndReturn(run func(signalCh chan<- *dbus.Signal)) *mockbus_signals_Call {
322 _c.Run(run)
323 return _c
324}
325
326// suspend provides a mock function for the type mockbus
327func (_mock *mockbus) suspend(context1 context.Context, s string) <-chan *dbus.Call {
328 ret := _mock.Called(context1, s)
329
330 if len(ret) == 0 {
331 panic("no return value specified for suspend")
332 }
333
334 var r0 <-chan *dbus.Call
335 if returnFunc, ok := ret.Get(0).(func(context.Context, string) <-chan *dbus.Call); ok {
336 r0 = returnFunc(context1, s)
337 } else {
338 if ret.Get(0) != nil {
339 r0 = ret.Get(0).(<-chan *dbus.Call)
340 }
341 }
342 return r0
343}
344
345// mockbus_suspend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'suspend'
346type mockbus_suspend_Call struct {
347 *mock.Call
348}
349
350// suspend is a helper method to define mock.On call
351// - context1 context.Context
352// - s string
353func (_e *mockbus_Expecter) suspend(context1 any, s any) *mockbus_suspend_Call {
354 return &mockbus_suspend_Call{Call: _e.mock.On("suspend", context1, s)}
355}
356
357func (_c *mockbus_suspend_Call) Run(run func(context1 context.Context, s string)) *mockbus_suspend_Call {
358 _c.Call.Run(func(args mock.Arguments) {
359 var arg0 context.Context
360 if args[0] != nil {
361 arg0 = args[0].(context.Context)
362 }
363 var arg1 string
364 if args[1] != nil {
365 arg1 = args[1].(string)
366 }
367 run(
368 arg0,
369 arg1,
370 )
371 })
372 return _c
373}
374
375func (_c *mockbus_suspend_Call) Return(callCh <-chan *dbus.Call) *mockbus_suspend_Call {
376 _c.Call.Return(callCh)
377 return _c
378}
379
380func (_c *mockbus_suspend_Call) RunAndReturn(run func(context1 context.Context, s string) <-chan *dbus.Call) *mockbus_suspend_Call {
381 _c.Call.Return(run)
382 return _c
383}
384
385// unixFDs provides a mock function for the type mockbus
386func (_mock *mockbus) unixFDs() bool {
387 ret := _mock.Called()
388
389 if len(ret) == 0 {
390 panic("no return value specified for unixFDs")
391 }
392
393 var r0 bool
394 if returnFunc, ok := ret.Get(0).(func() bool); ok {
395 r0 = returnFunc()
396 } else {
397 r0 = ret.Get(0).(bool)
398 }
399 return r0
400}
401
402// mockbus_unixFDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'unixFDs'
403type mockbus_unixFDs_Call struct {
404 *mock.Call
405}
406
407// unixFDs is a helper method to define mock.On call
408func (_e *mockbus_Expecter) unixFDs() *mockbus_unixFDs_Call {
409 return &mockbus_unixFDs_Call{Call: _e.mock.On("unixFDs")}
410}
411
412func (_c *mockbus_unixFDs_Call) Run(run func()) *mockbus_unixFDs_Call {
413 _c.Call.Run(func(args mock.Arguments) {
414 run()
415 })
416 return _c
417}
418
419func (_c *mockbus_unixFDs_Call) Return(b bool) *mockbus_unixFDs_Call {
420 _c.Call.Return(b)
421 return _c
422}
423
424func (_c *mockbus_unixFDs_Call) RunAndReturn(run func() bool) *mockbus_unixFDs_Call {
425 _c.Call.Return(run)
426 return _c
427}