aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/gcs
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-07-01 19:09:33 +0200
committerTaras Madan <tarasmadan@google.com>2025-07-01 21:41:27 +0000
commitbc80e4f080d226b12fae367dc46bc54ac3681009 (patch)
tree396991c29ca9a28b701a72013e5283ef0188b8ec /pkg/gcs
parent065d1b73397a6839320b1fc6cb5b40e8623a4825 (diff)
all/mocks: regenerate with mockery v3
Diffstat (limited to 'pkg/gcs')
-rw-r--r--pkg/gcs/mocks/Client.go248
1 files changed, 142 insertions, 106 deletions
diff --git a/pkg/gcs/mocks/Client.go b/pkg/gcs/mocks/Client.go
index d422b9c41..c8d2501f5 100644
--- a/pkg/gcs/mocks/Client.go
+++ b/pkg/gcs/mocks/Client.go
@@ -1,15 +1,30 @@
-// Code generated by mockery v2.52.1. DO NOT EDIT.
+// Code generated by mockery; DO NOT EDIT.
+// github.com/vektra/mockery
+// template: testify
package mocks
import (
- io "io"
-
- gcs "github.com/google/syzkaller/pkg/gcs"
+ "io"
+ "github.com/google/syzkaller/pkg/gcs"
mock "github.com/stretchr/testify/mock"
)
+// NewClient creates a new instance of Client. 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 NewClient(t interface {
+ mock.TestingT
+ Cleanup(func())
+}) *Client {
+ mock := &Client{}
+ mock.Mock.Test(t)
+
+ t.Cleanup(func() { mock.AssertExpectations(t) })
+
+ return mock
+}
+
// Client is an autogenerated mock type for the Client type
type Client struct {
mock.Mock
@@ -23,21 +38,20 @@ func (_m *Client) EXPECT() *Client_Expecter {
return &Client_Expecter{mock: &_m.Mock}
}
-// Close provides a mock function with no fields
-func (_m *Client) Close() error {
- ret := _m.Called()
+// Close provides a mock function for the type Client
+func (_mock *Client) Close() error {
+ ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Close")
}
var r0 error
- if rf, ok := ret.Get(0).(func() error); ok {
- r0 = rf()
+ if returnFunc, ok := ret.Get(0).(func() error); ok {
+ r0 = returnFunc()
} else {
r0 = ret.Error(0)
}
-
return r0
}
@@ -58,8 +72,8 @@ func (_c *Client_Close_Call) Run(run func()) *Client_Close_Call {
return _c
}
-func (_c *Client_Close_Call) Return(_a0 error) *Client_Close_Call {
- _c.Call.Return(_a0)
+func (_c *Client_Close_Call) Return(err error) *Client_Close_Call {
+ _c.Call.Return(err)
return _c
}
@@ -68,21 +82,20 @@ func (_c *Client_Close_Call) RunAndReturn(run func() error) *Client_Close_Call {
return _c
}
-// DeleteFile provides a mock function with given fields: path
-func (_m *Client) DeleteFile(path string) error {
- ret := _m.Called(path)
+// DeleteFile provides a mock function for the type Client
+func (_mock *Client) DeleteFile(path string) error {
+ ret := _mock.Called(path)
if len(ret) == 0 {
panic("no return value specified for DeleteFile")
}
var r0 error
- if rf, ok := ret.Get(0).(func(string) error); ok {
- r0 = rf(path)
+ if returnFunc, ok := ret.Get(0).(func(string) error); ok {
+ r0 = returnFunc(path)
} else {
r0 = ret.Error(0)
}
-
return r0
}
@@ -99,24 +112,30 @@ func (_e *Client_Expecter) DeleteFile(path interface{}) *Client_DeleteFile_Call
func (_c *Client_DeleteFile_Call) Run(run func(path string)) *Client_DeleteFile_Call {
_c.Call.Run(func(args mock.Arguments) {
- run(args[0].(string))
+ var arg0 string
+ if args[0] != nil {
+ arg0 = args[0].(string)
+ }
+ run(
+ arg0,
+ )
})
return _c
}
-func (_c *Client_DeleteFile_Call) Return(_a0 error) *Client_DeleteFile_Call {
- _c.Call.Return(_a0)
+func (_c *Client_DeleteFile_Call) Return(err error) *Client_DeleteFile_Call {
+ _c.Call.Return(err)
return _c
}
-func (_c *Client_DeleteFile_Call) RunAndReturn(run func(string) error) *Client_DeleteFile_Call {
+func (_c *Client_DeleteFile_Call) RunAndReturn(run func(path string) error) *Client_DeleteFile_Call {
_c.Call.Return(run)
return _c
}
-// FileExists provides a mock function with given fields: path
-func (_m *Client) FileExists(path string) (bool, error) {
- ret := _m.Called(path)
+// FileExists provides a mock function for the type Client
+func (_mock *Client) FileExists(path string) (bool, error) {
+ ret := _mock.Called(path)
if len(ret) == 0 {
panic("no return value specified for FileExists")
@@ -124,21 +143,19 @@ func (_m *Client) FileExists(path string) (bool, error) {
var r0 bool
var r1 error
- if rf, ok := ret.Get(0).(func(string) (bool, error)); ok {
- return rf(path)
+ if returnFunc, ok := ret.Get(0).(func(string) (bool, error)); ok {
+ return returnFunc(path)
}
- if rf, ok := ret.Get(0).(func(string) bool); ok {
- r0 = rf(path)
+ if returnFunc, ok := ret.Get(0).(func(string) bool); ok {
+ r0 = returnFunc(path)
} else {
r0 = ret.Get(0).(bool)
}
-
- if rf, ok := ret.Get(1).(func(string) error); ok {
- r1 = rf(path)
+ if returnFunc, ok := ret.Get(1).(func(string) error); ok {
+ r1 = returnFunc(path)
} else {
r1 = ret.Error(1)
}
-
return r0, r1
}
@@ -155,24 +172,30 @@ func (_e *Client_Expecter) FileExists(path interface{}) *Client_FileExists_Call
func (_c *Client_FileExists_Call) Run(run func(path string)) *Client_FileExists_Call {
_c.Call.Run(func(args mock.Arguments) {
- run(args[0].(string))
+ var arg0 string
+ if args[0] != nil {
+ arg0 = args[0].(string)
+ }
+ run(
+ arg0,
+ )
})
return _c
}
-func (_c *Client_FileExists_Call) Return(_a0 bool, _a1 error) *Client_FileExists_Call {
- _c.Call.Return(_a0, _a1)
+func (_c *Client_FileExists_Call) Return(b bool, err error) *Client_FileExists_Call {
+ _c.Call.Return(b, err)
return _c
}
-func (_c *Client_FileExists_Call) RunAndReturn(run func(string) (bool, error)) *Client_FileExists_Call {
+func (_c *Client_FileExists_Call) RunAndReturn(run func(path string) (bool, error)) *Client_FileExists_Call {
_c.Call.Return(run)
return _c
}
-// FileReader provides a mock function with given fields: path
-func (_m *Client) FileReader(path string) (io.ReadCloser, error) {
- ret := _m.Called(path)
+// FileReader provides a mock function for the type Client
+func (_mock *Client) FileReader(path string) (io.ReadCloser, error) {
+ ret := _mock.Called(path)
if len(ret) == 0 {
panic("no return value specified for FileReader")
@@ -180,23 +203,21 @@ func (_m *Client) FileReader(path string) (io.ReadCloser, error) {
var r0 io.ReadCloser
var r1 error
- if rf, ok := ret.Get(0).(func(string) (io.ReadCloser, error)); ok {
- return rf(path)
+ if returnFunc, ok := ret.Get(0).(func(string) (io.ReadCloser, error)); ok {
+ return returnFunc(path)
}
- if rf, ok := ret.Get(0).(func(string) io.ReadCloser); ok {
- r0 = rf(path)
+ if returnFunc, ok := ret.Get(0).(func(string) io.ReadCloser); ok {
+ r0 = returnFunc(path)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(io.ReadCloser)
}
}
-
- if rf, ok := ret.Get(1).(func(string) error); ok {
- r1 = rf(path)
+ if returnFunc, ok := ret.Get(1).(func(string) error); ok {
+ r1 = returnFunc(path)
} else {
r1 = ret.Error(1)
}
-
return r0, r1
}
@@ -213,24 +234,30 @@ func (_e *Client_Expecter) FileReader(path interface{}) *Client_FileReader_Call
func (_c *Client_FileReader_Call) Run(run func(path string)) *Client_FileReader_Call {
_c.Call.Run(func(args mock.Arguments) {
- run(args[0].(string))
+ var arg0 string
+ if args[0] != nil {
+ arg0 = args[0].(string)
+ }
+ run(
+ arg0,
+ )
})
return _c
}
-func (_c *Client_FileReader_Call) Return(_a0 io.ReadCloser, _a1 error) *Client_FileReader_Call {
- _c.Call.Return(_a0, _a1)
+func (_c *Client_FileReader_Call) Return(readCloser io.ReadCloser, err error) *Client_FileReader_Call {
+ _c.Call.Return(readCloser, err)
return _c
}
-func (_c *Client_FileReader_Call) RunAndReturn(run func(string) (io.ReadCloser, error)) *Client_FileReader_Call {
+func (_c *Client_FileReader_Call) RunAndReturn(run func(path string) (io.ReadCloser, error)) *Client_FileReader_Call {
_c.Call.Return(run)
return _c
}
-// FileWriter provides a mock function with given fields: path, contentType, contentEncoding
-func (_m *Client) FileWriter(path string, contentType string, contentEncoding string) (io.WriteCloser, error) {
- ret := _m.Called(path, contentType, contentEncoding)
+// FileWriter provides a mock function for the type Client
+func (_mock *Client) FileWriter(path string, contentType string, contentEncoding string) (io.WriteCloser, error) {
+ ret := _mock.Called(path, contentType, contentEncoding)
if len(ret) == 0 {
panic("no return value specified for FileWriter")
@@ -238,23 +265,21 @@ func (_m *Client) FileWriter(path string, contentType string, contentEncoding st
var r0 io.WriteCloser
var r1 error
- if rf, ok := ret.Get(0).(func(string, string, string) (io.WriteCloser, error)); ok {
- return rf(path, contentType, contentEncoding)
+ if returnFunc, ok := ret.Get(0).(func(string, string, string) (io.WriteCloser, error)); ok {
+ return returnFunc(path, contentType, contentEncoding)
}
- if rf, ok := ret.Get(0).(func(string, string, string) io.WriteCloser); ok {
- r0 = rf(path, contentType, contentEncoding)
+ if returnFunc, ok := ret.Get(0).(func(string, string, string) io.WriteCloser); ok {
+ r0 = returnFunc(path, contentType, contentEncoding)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(io.WriteCloser)
}
}
-
- if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
- r1 = rf(path, contentType, contentEncoding)
+ if returnFunc, ok := ret.Get(1).(func(string, string, string) error); ok {
+ r1 = returnFunc(path, contentType, contentEncoding)
} else {
r1 = ret.Error(1)
}
-
return r0, r1
}
@@ -273,24 +298,40 @@ func (_e *Client_Expecter) FileWriter(path interface{}, contentType interface{},
func (_c *Client_FileWriter_Call) Run(run func(path string, contentType string, contentEncoding string)) *Client_FileWriter_Call {
_c.Call.Run(func(args mock.Arguments) {
- run(args[0].(string), args[1].(string), args[2].(string))
+ var arg0 string
+ if args[0] != nil {
+ arg0 = args[0].(string)
+ }
+ var arg1 string
+ if args[1] != nil {
+ arg1 = args[1].(string)
+ }
+ var arg2 string
+ if args[2] != nil {
+ arg2 = args[2].(string)
+ }
+ run(
+ arg0,
+ arg1,
+ arg2,
+ )
})
return _c
}
-func (_c *Client_FileWriter_Call) Return(_a0 io.WriteCloser, _a1 error) *Client_FileWriter_Call {
- _c.Call.Return(_a0, _a1)
+func (_c *Client_FileWriter_Call) Return(writeCloser io.WriteCloser, err error) *Client_FileWriter_Call {
+ _c.Call.Return(writeCloser, err)
return _c
}
-func (_c *Client_FileWriter_Call) RunAndReturn(run func(string, string, string) (io.WriteCloser, error)) *Client_FileWriter_Call {
+func (_c *Client_FileWriter_Call) RunAndReturn(run func(path string, contentType string, contentEncoding string) (io.WriteCloser, error)) *Client_FileWriter_Call {
_c.Call.Return(run)
return _c
}
-// ListObjects provides a mock function with given fields: path
-func (_m *Client) ListObjects(path string) ([]*gcs.Object, error) {
- ret := _m.Called(path)
+// ListObjects provides a mock function for the type Client
+func (_mock *Client) ListObjects(path string) ([]*gcs.Object, error) {
+ ret := _mock.Called(path)
if len(ret) == 0 {
panic("no return value specified for ListObjects")
@@ -298,23 +339,21 @@ func (_m *Client) ListObjects(path string) ([]*gcs.Object, error) {
var r0 []*gcs.Object
var r1 error
- if rf, ok := ret.Get(0).(func(string) ([]*gcs.Object, error)); ok {
- return rf(path)
+ if returnFunc, ok := ret.Get(0).(func(string) ([]*gcs.Object, error)); ok {
+ return returnFunc(path)
}
- if rf, ok := ret.Get(0).(func(string) []*gcs.Object); ok {
- r0 = rf(path)
+ if returnFunc, ok := ret.Get(0).(func(string) []*gcs.Object); ok {
+ r0 = returnFunc(path)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*gcs.Object)
}
}
-
- if rf, ok := ret.Get(1).(func(string) error); ok {
- r1 = rf(path)
+ if returnFunc, ok := ret.Get(1).(func(string) error); ok {
+ r1 = returnFunc(path)
} else {
r1 = ret.Error(1)
}
-
return r0, r1
}
@@ -331,36 +370,41 @@ func (_e *Client_Expecter) ListObjects(path interface{}) *Client_ListObjects_Cal
func (_c *Client_ListObjects_Call) Run(run func(path string)) *Client_ListObjects_Call {
_c.Call.Run(func(args mock.Arguments) {
- run(args[0].(string))
+ var arg0 string
+ if args[0] != nil {
+ arg0 = args[0].(string)
+ }
+ run(
+ arg0,
+ )
})
return _c
}
-func (_c *Client_ListObjects_Call) Return(_a0 []*gcs.Object, _a1 error) *Client_ListObjects_Call {
- _c.Call.Return(_a0, _a1)
+func (_c *Client_ListObjects_Call) Return(objects []*gcs.Object, err error) *Client_ListObjects_Call {
+ _c.Call.Return(objects, err)
return _c
}
-func (_c *Client_ListObjects_Call) RunAndReturn(run func(string) ([]*gcs.Object, error)) *Client_ListObjects_Call {
+func (_c *Client_ListObjects_Call) RunAndReturn(run func(path string) ([]*gcs.Object, error)) *Client_ListObjects_Call {
_c.Call.Return(run)
return _c
}
-// Publish provides a mock function with given fields: path
-func (_m *Client) Publish(path string) error {
- ret := _m.Called(path)
+// Publish provides a mock function for the type Client
+func (_mock *Client) Publish(path string) error {
+ ret := _mock.Called(path)
if len(ret) == 0 {
panic("no return value specified for Publish")
}
var r0 error
- if rf, ok := ret.Get(0).(func(string) error); ok {
- r0 = rf(path)
+ if returnFunc, ok := ret.Get(0).(func(string) error); ok {
+ r0 = returnFunc(path)
} else {
r0 = ret.Error(0)
}
-
return r0
}
@@ -377,31 +421,23 @@ func (_e *Client_Expecter) Publish(path interface{}) *Client_Publish_Call {
func (_c *Client_Publish_Call) Run(run func(path string)) *Client_Publish_Call {
_c.Call.Run(func(args mock.Arguments) {
- run(args[0].(string))
+ var arg0 string
+ if args[0] != nil {
+ arg0 = args[0].(string)
+ }
+ run(
+ arg0,
+ )
})
return _c
}
-func (_c *Client_Publish_Call) Return(_a0 error) *Client_Publish_Call {
- _c.Call.Return(_a0)
+func (_c *Client_Publish_Call) Return(err error) *Client_Publish_Call {
+ _c.Call.Return(err)
return _c
}
-func (_c *Client_Publish_Call) RunAndReturn(run func(string) error) *Client_Publish_Call {
+func (_c *Client_Publish_Call) RunAndReturn(run func(path string) error) *Client_Publish_Call {
_c.Call.Return(run)
return _c
}
-
-// NewClient creates a new instance of Client. 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 NewClient(t interface {
- mock.TestingT
- Cleanup(func())
-}) *Client {
- mock := &Client{}
- mock.Mock.Test(t)
-
- t.Cleanup(func() { mock.AssertExpectations(t) })
-
- return mock
-}