mock_function.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. // Code generated by mockery v2.32.4. DO NOT EDIT.
  2. package function
  3. import (
  4. schemapb "github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
  5. mock "github.com/stretchr/testify/mock"
  6. )
  7. // MockFunctionRunner is an autogenerated mock type for the FunctionRunner type
  8. type MockFunctionRunner struct {
  9. mock.Mock
  10. }
  11. type MockFunctionRunner_Expecter struct {
  12. mock *mock.Mock
  13. }
  14. func (_m *MockFunctionRunner) EXPECT() *MockFunctionRunner_Expecter {
  15. return &MockFunctionRunner_Expecter{mock: &_m.Mock}
  16. }
  17. // BatchRun provides a mock function with given fields: inputs
  18. func (_m *MockFunctionRunner) BatchRun(inputs ...interface{}) ([]interface{}, error) {
  19. var _ca []interface{}
  20. _ca = append(_ca, inputs...)
  21. ret := _m.Called(_ca...)
  22. var r0 []interface{}
  23. var r1 error
  24. if rf, ok := ret.Get(0).(func(...interface{}) ([]interface{}, error)); ok {
  25. return rf(inputs...)
  26. }
  27. if rf, ok := ret.Get(0).(func(...interface{}) []interface{}); ok {
  28. r0 = rf(inputs...)
  29. } else {
  30. if ret.Get(0) != nil {
  31. r0 = ret.Get(0).([]interface{})
  32. }
  33. }
  34. if rf, ok := ret.Get(1).(func(...interface{}) error); ok {
  35. r1 = rf(inputs...)
  36. } else {
  37. r1 = ret.Error(1)
  38. }
  39. return r0, r1
  40. }
  41. // MockFunctionRunner_BatchRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchRun'
  42. type MockFunctionRunner_BatchRun_Call struct {
  43. *mock.Call
  44. }
  45. // BatchRun is a helper method to define mock.On call
  46. // - inputs ...interface{}
  47. func (_e *MockFunctionRunner_Expecter) BatchRun(inputs ...interface{}) *MockFunctionRunner_BatchRun_Call {
  48. return &MockFunctionRunner_BatchRun_Call{Call: _e.mock.On("BatchRun",
  49. append([]interface{}{}, inputs...)...)}
  50. }
  51. func (_c *MockFunctionRunner_BatchRun_Call) Run(run func(inputs ...interface{})) *MockFunctionRunner_BatchRun_Call {
  52. _c.Call.Run(func(args mock.Arguments) {
  53. variadicArgs := make([]interface{}, len(args)-0)
  54. for i, a := range args[0:] {
  55. if a != nil {
  56. variadicArgs[i] = a.(interface{})
  57. }
  58. }
  59. run(variadicArgs...)
  60. })
  61. return _c
  62. }
  63. func (_c *MockFunctionRunner_BatchRun_Call) Return(_a0 []interface{}, _a1 error) *MockFunctionRunner_BatchRun_Call {
  64. _c.Call.Return(_a0, _a1)
  65. return _c
  66. }
  67. func (_c *MockFunctionRunner_BatchRun_Call) RunAndReturn(run func(...interface{}) ([]interface{}, error)) *MockFunctionRunner_BatchRun_Call {
  68. _c.Call.Return(run)
  69. return _c
  70. }
  71. // GetOutputFields provides a mock function with given fields:
  72. func (_m *MockFunctionRunner) GetOutputFields() []*schemapb.FieldSchema {
  73. ret := _m.Called()
  74. var r0 []*schemapb.FieldSchema
  75. if rf, ok := ret.Get(0).(func() []*schemapb.FieldSchema); ok {
  76. r0 = rf()
  77. } else {
  78. if ret.Get(0) != nil {
  79. r0 = ret.Get(0).([]*schemapb.FieldSchema)
  80. }
  81. }
  82. return r0
  83. }
  84. // MockFunctionRunner_GetOutputFields_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOutputFields'
  85. type MockFunctionRunner_GetOutputFields_Call struct {
  86. *mock.Call
  87. }
  88. // GetOutputFields is a helper method to define mock.On call
  89. func (_e *MockFunctionRunner_Expecter) GetOutputFields() *MockFunctionRunner_GetOutputFields_Call {
  90. return &MockFunctionRunner_GetOutputFields_Call{Call: _e.mock.On("GetOutputFields")}
  91. }
  92. func (_c *MockFunctionRunner_GetOutputFields_Call) Run(run func()) *MockFunctionRunner_GetOutputFields_Call {
  93. _c.Call.Run(func(args mock.Arguments) {
  94. run()
  95. })
  96. return _c
  97. }
  98. func (_c *MockFunctionRunner_GetOutputFields_Call) Return(_a0 []*schemapb.FieldSchema) *MockFunctionRunner_GetOutputFields_Call {
  99. _c.Call.Return(_a0)
  100. return _c
  101. }
  102. func (_c *MockFunctionRunner_GetOutputFields_Call) RunAndReturn(run func() []*schemapb.FieldSchema) *MockFunctionRunner_GetOutputFields_Call {
  103. _c.Call.Return(run)
  104. return _c
  105. }
  106. // GetSchema provides a mock function with given fields:
  107. func (_m *MockFunctionRunner) GetSchema() *schemapb.FunctionSchema {
  108. ret := _m.Called()
  109. var r0 *schemapb.FunctionSchema
  110. if rf, ok := ret.Get(0).(func() *schemapb.FunctionSchema); ok {
  111. r0 = rf()
  112. } else {
  113. if ret.Get(0) != nil {
  114. r0 = ret.Get(0).(*schemapb.FunctionSchema)
  115. }
  116. }
  117. return r0
  118. }
  119. // MockFunctionRunner_GetSchema_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSchema'
  120. type MockFunctionRunner_GetSchema_Call struct {
  121. *mock.Call
  122. }
  123. // GetSchema is a helper method to define mock.On call
  124. func (_e *MockFunctionRunner_Expecter) GetSchema() *MockFunctionRunner_GetSchema_Call {
  125. return &MockFunctionRunner_GetSchema_Call{Call: _e.mock.On("GetSchema")}
  126. }
  127. func (_c *MockFunctionRunner_GetSchema_Call) Run(run func()) *MockFunctionRunner_GetSchema_Call {
  128. _c.Call.Run(func(args mock.Arguments) {
  129. run()
  130. })
  131. return _c
  132. }
  133. func (_c *MockFunctionRunner_GetSchema_Call) Return(_a0 *schemapb.FunctionSchema) *MockFunctionRunner_GetSchema_Call {
  134. _c.Call.Return(_a0)
  135. return _c
  136. }
  137. func (_c *MockFunctionRunner_GetSchema_Call) RunAndReturn(run func() *schemapb.FunctionSchema) *MockFunctionRunner_GetSchema_Call {
  138. _c.Call.Return(run)
  139. return _c
  140. }
  141. // NewMockFunctionRunner creates a new instance of MockFunctionRunner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  142. // The first argument is typically a *testing.T value.
  143. func NewMockFunctionRunner(t interface {
  144. mock.TestingT
  145. Cleanup(func())
  146. }) *MockFunctionRunner {
  147. mock := &MockFunctionRunner{}
  148. mock.Mock.Test(t)
  149. t.Cleanup(func() { mock.AssertExpectations(t) })
  150. return mock
  151. }