diff options
| author | jannfis <jann@mistrust.net> | 2024-05-27 19:38:30 +0000 |
|---|---|---|
| committer | jannfis <jann@mistrust.net> | 2024-05-27 19:40:33 +0000 |
| commit | 67f3d349f9fb60bb232cf6f0734a090bc48f5a4e (patch) | |
| tree | f8b3731f82b98982d4f26ee598635d7932efed19 /ext/git/mocks | |
| parent | eb1d8d30bb22cb82928df64fd5028fa978f8cb5b (diff) | |
chore(deps): Pull in Git client changes from Argo CD v2.11.2
Signed-off-by: jannfis <jann@mistrust.net>
Diffstat (limited to 'ext/git/mocks')
| -rw-r--r-- | ext/git/mocks/Client.go | 217 |
1 files changed, 194 insertions, 23 deletions
diff --git a/ext/git/mocks/Client.go b/ext/git/mocks/Client.go index 645e065..6325228 100644 --- a/ext/git/mocks/Client.go +++ b/ext/git/mocks/Client.go @@ -1,11 +1,10 @@ -// Code generated by mockery v1.1.2. DO NOT EDIT. +// Code generated by mockery v2.43.0. DO NOT EDIT. package mocks import ( - mock "github.com/stretchr/testify/mock" - git "github.com/argoproj-labs/argocd-image-updater/ext/git" + mock "github.com/stretchr/testify/mock" ) // Client is an autogenerated mock type for the Client type @@ -17,6 +16,10 @@ type Client struct { func (_m *Client) Add(path string) error { ret := _m.Called(path) + if len(ret) == 0 { + panic("no return value specified for Add") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(path) @@ -31,6 +34,10 @@ func (_m *Client) Add(path string) error { func (_m *Client) Branch(sourceBranch string, targetBranch string) error { ret := _m.Called(sourceBranch, targetBranch) + if len(ret) == 0 { + panic("no return value specified for Branch") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(sourceBranch, targetBranch) @@ -41,13 +48,47 @@ func (_m *Client) Branch(sourceBranch string, targetBranch string) error { return r0 } -// Checkout provides a mock function with given fields: revision -func (_m *Client) Checkout(revision string) error { - ret := _m.Called(revision) +// ChangedFiles provides a mock function with given fields: revision, targetRevision +func (_m *Client) ChangedFiles(revision string, targetRevision string) ([]string, error) { + ret := _m.Called(revision, targetRevision) + + if len(ret) == 0 { + panic("no return value specified for ChangedFiles") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]string, error)); ok { + return rf(revision, targetRevision) + } + if rf, ok := ret.Get(0).(func(string, string) []string); ok { + r0 = rf(revision, targetRevision) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func(string, string) error); ok { + r1 = rf(revision, targetRevision) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Checkout provides a mock function with given fields: revision, submoduleEnabled +func (_m *Client) Checkout(revision string, submoduleEnabled bool) error { + ret := _m.Called(revision, submoduleEnabled) + + if len(ret) == 0 { + panic("no return value specified for Checkout") + } var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(revision) + if rf, ok := ret.Get(0).(func(string, bool) error); ok { + r0 = rf(revision, submoduleEnabled) } else { r0 = ret.Error(0) } @@ -59,6 +100,10 @@ func (_m *Client) Checkout(revision string) error { func (_m *Client) Commit(pathSpec string, opts *git.CommitOptions) error { ret := _m.Called(pathSpec, opts) + if len(ret) == 0 { + panic("no return value specified for Commit") + } + var r0 error if rf, ok := ret.Get(0).(func(string, *git.CommitOptions) error); ok { r0 = rf(pathSpec, opts) @@ -73,14 +118,21 @@ func (_m *Client) Commit(pathSpec string, opts *git.CommitOptions) error { func (_m *Client) CommitSHA() (string, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for CommitSHA") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -94,6 +146,10 @@ func (_m *Client) CommitSHA() (string, error) { func (_m *Client) Config(username string, email string) error { ret := _m.Called(username, email) + if len(ret) == 0 { + panic("no return value specified for Config") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(username, email) @@ -108,6 +164,10 @@ func (_m *Client) Config(username string, email string) error { func (_m *Client) Fetch(revision string) error { ret := _m.Called(revision) + if len(ret) == 0 { + panic("no return value specified for Fetch") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(revision) @@ -122,6 +182,10 @@ func (_m *Client) Fetch(revision string) error { func (_m *Client) Init() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Init") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -132,22 +196,47 @@ func (_m *Client) Init() error { return r0 } -// LsFiles provides a mock function with given fields: path -func (_m *Client) LsFiles(path string) ([]string, error) { - ret := _m.Called(path) +// IsAnnotatedTag provides a mock function with given fields: _a0 +func (_m *Client) IsAnnotatedTag(_a0 string) bool { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for IsAnnotatedTag") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(string) bool); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// LsFiles provides a mock function with given fields: path, enableNewGitFileGlobbing +func (_m *Client) LsFiles(path string, enableNewGitFileGlobbing bool) ([]string, error) { + ret := _m.Called(path, enableNewGitFileGlobbing) + + if len(ret) == 0 { + panic("no return value specified for LsFiles") + } var r0 []string - if rf, ok := ret.Get(0).(func(string) []string); ok { - r0 = rf(path) + var r1 error + if rf, ok := ret.Get(0).(func(string, bool) ([]string, error)); ok { + return rf(path, enableNewGitFileGlobbing) + } + if rf, ok := ret.Get(0).(func(string, bool) []string); ok { + r0 = rf(path, enableNewGitFileGlobbing) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]string) } } - var r1 error - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(path) + if rf, ok := ret.Get(1).(func(string, bool) error); ok { + r1 = rf(path, enableNewGitFileGlobbing) } else { r1 = ret.Error(1) } @@ -159,7 +248,15 @@ func (_m *Client) LsFiles(path string) ([]string, error) { func (_m *Client) LsLargeFiles() ([]string, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LsLargeFiles") + } + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func() ([]string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []string); ok { r0 = rf() } else { @@ -168,7 +265,6 @@ func (_m *Client) LsLargeFiles() ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -182,7 +278,15 @@ func (_m *Client) LsLargeFiles() ([]string, error) { func (_m *Client) LsRefs() (*git.Refs, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for LsRefs") + } + var r0 *git.Refs + var r1 error + if rf, ok := ret.Get(0).(func() (*git.Refs, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *git.Refs); ok { r0 = rf() } else { @@ -191,7 +295,6 @@ func (_m *Client) LsRefs() (*git.Refs, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -205,14 +308,21 @@ func (_m *Client) LsRefs() (*git.Refs, error) { func (_m *Client) LsRemote(revision string) (string, error) { ret := _m.Called(revision) + if len(ret) == 0 { + panic("no return value specified for LsRemote") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string) (string, error)); ok { + return rf(revision) + } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(revision) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(revision) } else { @@ -226,6 +336,10 @@ func (_m *Client) LsRemote(revision string) (string, error) { func (_m *Client) Push(remote string, branch string, force bool) error { ret := _m.Called(remote, branch, force) + if len(ret) == 0 { + panic("no return value specified for Push") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string, bool) error); ok { r0 = rf(remote, branch, force) @@ -240,7 +354,15 @@ func (_m *Client) Push(remote string, branch string, force bool) error { func (_m *Client) RevisionMetadata(revision string) (*git.RevisionMetadata, error) { ret := _m.Called(revision) + if len(ret) == 0 { + panic("no return value specified for RevisionMetadata") + } + var r0 *git.RevisionMetadata + var r1 error + if rf, ok := ret.Get(0).(func(string) (*git.RevisionMetadata, error)); ok { + return rf(revision) + } if rf, ok := ret.Get(0).(func(string) *git.RevisionMetadata); ok { r0 = rf(revision) } else { @@ -249,7 +371,6 @@ func (_m *Client) RevisionMetadata(revision string) (*git.RevisionMetadata, erro } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(revision) } else { @@ -263,6 +384,10 @@ func (_m *Client) RevisionMetadata(revision string) (*git.RevisionMetadata, erro func (_m *Client) Root() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Root") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -273,18 +398,43 @@ func (_m *Client) Root() string { return r0 } +// Submodule provides a mock function with given fields: +func (_m *Client) Submodule() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Submodule") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + // SymRefToBranch provides a mock function with given fields: symRef func (_m *Client) SymRefToBranch(symRef string) (string, error) { ret := _m.Called(symRef) + if len(ret) == 0 { + panic("no return value specified for SymRefToBranch") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string) (string, error)); ok { + return rf(symRef) + } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(symRef) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(symRef) } else { @@ -298,14 +448,21 @@ func (_m *Client) SymRefToBranch(symRef string) (string, error) { func (_m *Client) VerifyCommitSignature(_a0 string) (string, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for VerifyCommitSignature") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string) (string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(_a0) } else { @@ -314,3 +471,17 @@ func (_m *Client) VerifyCommitSignature(_a0 string) (string, error) { return r0, r1 } + +// 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 +} |
