// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package logind import ( "context" "github.com/godbus/dbus/v5" mock "github.com/stretchr/testify/mock" ) // 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. // The first argument is typically a *testing.T value. func newMockbus(t interface { mock.TestingT Cleanup(func()) }) *mockbus { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &mockbus{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // mockbus is an autogenerated mock type for the bus type type mockbus struct { mock.Mock } type mockbus_Expecter struct { mock *mock.Mock } func (_m *mockbus) EXPECT() *mockbus_Expecter { return &mockbus_Expecter{mock: &_m.Mock} } // call provides a mock function for the type mockbus func (_mock *mockbus) call(context1 context.Context, s string, objectPath dbus.ObjectPath, s1 string, anyMoqParams ...any) ([]any, error) { var tmpRet mock.Arguments if len(anyMoqParams) > 0 { tmpRet = _mock.Called(context1, s, objectPath, s1, anyMoqParams) } else { tmpRet = _mock.Called(context1, s, objectPath, s1) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for call") } var r0 []any var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, dbus.ObjectPath, string, ...any) ([]any, error)); ok { return returnFunc(context1, s, objectPath, s1, anyMoqParams...) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, dbus.ObjectPath, string, ...any) []any); ok { r0 = returnFunc(context1, s, objectPath, s1, anyMoqParams...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]any) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string, dbus.ObjectPath, string, ...any) error); ok { r1 = returnFunc(context1, s, objectPath, s1, anyMoqParams...) } else { r1 = ret.Error(1) } return r0, r1 } // mockbus_call_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'call' type mockbus_call_Call struct { *mock.Call } // call is a helper method to define mock.On call // - context1 context.Context // - s string // - objectPath dbus.ObjectPath // - s1 string // - anyMoqParams ...any func (_e *mockbus_Expecter) call(context1 any, s any, objectPath any, s1 any, anyMoqParams ...any) *mockbus_call_Call { return &mockbus_call_Call{Call: _e.mock.On("call", append([]any{context1, s, objectPath, s1}, anyMoqParams...)...)} } func (_c *mockbus_call_Call) Run(run func(context1 context.Context, s string, objectPath dbus.ObjectPath, s1 string, anyMoqParams ...any)) *mockbus_call_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } var arg2 dbus.ObjectPath if args[2] != nil { arg2 = args[2].(dbus.ObjectPath) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } var arg4 []any var variadicArgs []any if len(args) > 4 { variadicArgs = args[4].([]any) } arg4 = variadicArgs run( arg0, arg1, arg2, arg3, arg4..., ) }) return _c } func (_c *mockbus_call_Call) Return(anyMoqParams1 []any, err error) *mockbus_call_Call { _c.Call.Return(anyMoqParams1, err) return _c } func (_c *mockbus_call_Call) RunAndReturn(run func(context1 context.Context, s string, objectPath dbus.ObjectPath, s1 string, anyMoqParams ...any) ([]any, error)) *mockbus_call_Call { _c.Call.Return(run) return _c } // close provides a mock function for the type mockbus func (_mock *mockbus) close() error { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for close") } var r0 error if returnFunc, ok := ret.Get(0).(func() error); ok { r0 = returnFunc() } else { r0 = ret.Error(0) } return r0 } // mockbus_close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'close' type mockbus_close_Call struct { *mock.Call } // close is a helper method to define mock.On call func (_e *mockbus_Expecter) close() *mockbus_close_Call { return &mockbus_close_Call{Call: _e.mock.On("close")} } func (_c *mockbus_close_Call) Run(run func()) *mockbus_close_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *mockbus_close_Call) Return(err error) *mockbus_close_Call { _c.Call.Return(err) return _c } func (_c *mockbus_close_Call) RunAndReturn(run func() error) *mockbus_close_Call { _c.Call.Return(run) return _c } // match provides a mock function for the type mockbus func (_mock *mockbus) match(context1 context.Context, s string) error { ret := _mock.Called(context1, s) if len(ret) == 0 { panic("no return value specified for match") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { r0 = returnFunc(context1, s) } else { r0 = ret.Error(0) } return r0 } // mockbus_match_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'match' type mockbus_match_Call struct { *mock.Call } // match is a helper method to define mock.On call // - context1 context.Context // - s string func (_e *mockbus_Expecter) match(context1 any, s any) *mockbus_match_Call { return &mockbus_match_Call{Call: _e.mock.On("match", context1, s)} } func (_c *mockbus_match_Call) Run(run func(context1 context.Context, s string)) *mockbus_match_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *mockbus_match_Call) Return(err error) *mockbus_match_Call { _c.Call.Return(err) return _c } func (_c *mockbus_match_Call) RunAndReturn(run func(context1 context.Context, s string) error) *mockbus_match_Call { _c.Call.Return(run) return _c } // removeSignals provides a mock function for the type mockbus func (_mock *mockbus) removeSignals(signalCh chan<- *dbus.Signal) { _mock.Called(signalCh) return } // mockbus_removeSignals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'removeSignals' type mockbus_removeSignals_Call struct { *mock.Call } // removeSignals is a helper method to define mock.On call // - signalCh chan<- *dbus.Signal func (_e *mockbus_Expecter) removeSignals(signalCh any) *mockbus_removeSignals_Call { return &mockbus_removeSignals_Call{Call: _e.mock.On("removeSignals", signalCh)} } func (_c *mockbus_removeSignals_Call) Run(run func(signalCh chan<- *dbus.Signal)) *mockbus_removeSignals_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 chan<- *dbus.Signal if args[0] != nil { arg0 = args[0].(chan<- *dbus.Signal) } run( arg0, ) }) return _c } func (_c *mockbus_removeSignals_Call) Return() *mockbus_removeSignals_Call { _c.Call.Return() return _c } func (_c *mockbus_removeSignals_Call) RunAndReturn(run func(signalCh chan<- *dbus.Signal)) *mockbus_removeSignals_Call { _c.Run(run) return _c } // signals provides a mock function for the type mockbus func (_mock *mockbus) signals(signalCh chan<- *dbus.Signal) { _mock.Called(signalCh) return } // mockbus_signals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'signals' type mockbus_signals_Call struct { *mock.Call } // signals is a helper method to define mock.On call // - signalCh chan<- *dbus.Signal func (_e *mockbus_Expecter) signals(signalCh any) *mockbus_signals_Call { return &mockbus_signals_Call{Call: _e.mock.On("signals", signalCh)} } func (_c *mockbus_signals_Call) Run(run func(signalCh chan<- *dbus.Signal)) *mockbus_signals_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 chan<- *dbus.Signal if args[0] != nil { arg0 = args[0].(chan<- *dbus.Signal) } run( arg0, ) }) return _c } func (_c *mockbus_signals_Call) Return() *mockbus_signals_Call { _c.Call.Return() return _c } func (_c *mockbus_signals_Call) RunAndReturn(run func(signalCh chan<- *dbus.Signal)) *mockbus_signals_Call { _c.Run(run) return _c } // suspend provides a mock function for the type mockbus func (_mock *mockbus) suspend(context1 context.Context, s string) <-chan *dbus.Call { ret := _mock.Called(context1, s) if len(ret) == 0 { panic("no return value specified for suspend") } var r0 <-chan *dbus.Call if returnFunc, ok := ret.Get(0).(func(context.Context, string) <-chan *dbus.Call); ok { r0 = returnFunc(context1, s) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(<-chan *dbus.Call) } } return r0 } // mockbus_suspend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'suspend' type mockbus_suspend_Call struct { *mock.Call } // suspend is a helper method to define mock.On call // - context1 context.Context // - s string func (_e *mockbus_Expecter) suspend(context1 any, s any) *mockbus_suspend_Call { return &mockbus_suspend_Call{Call: _e.mock.On("suspend", context1, s)} } func (_c *mockbus_suspend_Call) Run(run func(context1 context.Context, s string)) *mockbus_suspend_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *mockbus_suspend_Call) Return(callCh <-chan *dbus.Call) *mockbus_suspend_Call { _c.Call.Return(callCh) return _c } func (_c *mockbus_suspend_Call) RunAndReturn(run func(context1 context.Context, s string) <-chan *dbus.Call) *mockbus_suspend_Call { _c.Call.Return(run) return _c } // unixFDs provides a mock function for the type mockbus func (_mock *mockbus) unixFDs() bool { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for unixFDs") } var r0 bool if returnFunc, ok := ret.Get(0).(func() bool); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(bool) } return r0 } // mockbus_unixFDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'unixFDs' type mockbus_unixFDs_Call struct { *mock.Call } // unixFDs is a helper method to define mock.On call func (_e *mockbus_Expecter) unixFDs() *mockbus_unixFDs_Call { return &mockbus_unixFDs_Call{Call: _e.mock.On("unixFDs")} } func (_c *mockbus_unixFDs_Call) Run(run func()) *mockbus_unixFDs_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *mockbus_unixFDs_Call) Return(b bool) *mockbus_unixFDs_Call { _c.Call.Return(b) return _c } func (_c *mockbus_unixFDs_Call) RunAndReturn(run func() bool) *mockbus_unixFDs_Call { _c.Call.Return(run) return _c }