aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/gcs/mocks/Client.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-03-25 12:56:07 +0100
committerTaras Madan <tarasmadan@google.com>2025-03-25 19:53:31 +0000
commit89d30d7360d4a366f8fdf00d6ac56cced7a45b0b (patch)
treed22b5e8682275911832473914c9640d1769805f4 /pkg/gcs/mocks/Client.go
parent875573af37b09758ab48042f2b8a368097204888 (diff)
pkg/gcs: define Client interface
Some functions are not the struct members now. Some functions deleted. Client mock generated.
Diffstat (limited to 'pkg/gcs/mocks/Client.go')
-rw-r--r--pkg/gcs/mocks/Client.go202
1 files changed, 202 insertions, 0 deletions
diff --git a/pkg/gcs/mocks/Client.go b/pkg/gcs/mocks/Client.go
new file mode 100644
index 000000000..80e72c73e
--- /dev/null
+++ b/pkg/gcs/mocks/Client.go
@@ -0,0 +1,202 @@
+// Code generated by mockery v2.52.1. DO NOT EDIT.
+
+package mocks
+
+import (
+ io "io"
+
+ gcs "github.com/google/syzkaller/pkg/gcs"
+
+ mock "github.com/stretchr/testify/mock"
+)
+
+// Client is an autogenerated mock type for the Client type
+type Client struct {
+ mock.Mock
+}
+
+// Close provides a mock function with no fields
+func (_m *Client) Close() error {
+ ret := _m.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()
+ } else {
+ r0 = ret.Error(0)
+ }
+
+ return r0
+}
+
+// DeleteFile provides a mock function with given fields: path
+func (_m *Client) DeleteFile(path string) error {
+ ret := _m.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)
+ } else {
+ r0 = ret.Error(0)
+ }
+
+ return r0
+}
+
+// FileExists provides a mock function with given fields: path
+func (_m *Client) FileExists(path string) (bool, error) {
+ ret := _m.Called(path)
+
+ if len(ret) == 0 {
+ panic("no return value specified for FileExists")
+ }
+
+ var r0 bool
+ var r1 error
+ if rf, ok := ret.Get(0).(func(string) (bool, error)); ok {
+ return rf(path)
+ }
+ if rf, ok := ret.Get(0).(func(string) bool); ok {
+ r0 = rf(path)
+ } else {
+ r0 = ret.Get(0).(bool)
+ }
+
+ if rf, ok := ret.Get(1).(func(string) error); ok {
+ r1 = rf(path)
+ } else {
+ r1 = ret.Error(1)
+ }
+
+ return r0, r1
+}
+
+// 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)
+
+ if len(ret) == 0 {
+ panic("no return value specified for FileWriter")
+ }
+
+ 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 rf, ok := ret.Get(0).(func(string, string, string) io.WriteCloser); ok {
+ r0 = rf(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)
+ } else {
+ r1 = ret.Error(1)
+ }
+
+ return r0, r1
+}
+
+// ListObjects provides a mock function with given fields: path
+func (_m *Client) ListObjects(path string) ([]*gcs.Object, error) {
+ ret := _m.Called(path)
+
+ if len(ret) == 0 {
+ panic("no return value specified for ListObjects")
+ }
+
+ var r0 []*gcs.Object
+ var r1 error
+ if rf, ok := ret.Get(0).(func(string) ([]*gcs.Object, error)); ok {
+ return rf(path)
+ }
+ if rf, ok := ret.Get(0).(func(string) []*gcs.Object); ok {
+ r0 = rf(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)
+ } else {
+ r1 = ret.Error(1)
+ }
+
+ return r0, r1
+}
+
+// Read provides a mock function with given fields: path
+func (_m *Client) Read(path string) (*gcs.File, error) {
+ ret := _m.Called(path)
+
+ if len(ret) == 0 {
+ panic("no return value specified for Read")
+ }
+
+ var r0 *gcs.File
+ var r1 error
+ if rf, ok := ret.Get(0).(func(string) (*gcs.File, error)); ok {
+ return rf(path)
+ }
+ if rf, ok := ret.Get(0).(func(string) *gcs.File); ok {
+ r0 = rf(path)
+ } else {
+ if ret.Get(0) != nil {
+ r0 = ret.Get(0).(*gcs.File)
+ }
+ }
+
+ if rf, ok := ret.Get(1).(func(string) error); ok {
+ r1 = rf(path)
+ } else {
+ r1 = ret.Error(1)
+ }
+
+ return r0, r1
+}
+
+// publish provides a mock function with given fields: path
+func (_m *Client) publish(path string) error {
+ ret := _m.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)
+ } else {
+ r0 = ret.Error(0)
+ }
+
+ return r0
+}
+
+// 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
+}