diff options
Diffstat (limited to 'registry-scanner/pkg/registry/mocks')
| -rw-r--r-- | registry-scanner/pkg/registry/mocks/Limiter.go | 46 | ||||
| -rw-r--r-- | registry-scanner/pkg/registry/mocks/Manager.go | 80 | ||||
| -rw-r--r-- | registry-scanner/pkg/registry/mocks/Manifest.go | 84 | ||||
| -rw-r--r-- | registry-scanner/pkg/registry/mocks/ManifestService.go | 149 | ||||
| -rw-r--r-- | registry-scanner/pkg/registry/mocks/RegistryClient.go | 125 | ||||
| -rw-r--r-- | registry-scanner/pkg/registry/mocks/Repository.go | 128 | ||||
| -rw-r--r-- | registry-scanner/pkg/registry/mocks/RoundTripper.go | 58 | ||||
| -rw-r--r-- | registry-scanner/pkg/registry/mocks/TagService.go | 153 |
8 files changed, 823 insertions, 0 deletions
diff --git a/registry-scanner/pkg/registry/mocks/Limiter.go b/registry-scanner/pkg/registry/mocks/Limiter.go new file mode 100644 index 0000000..81dbb19 --- /dev/null +++ b/registry-scanner/pkg/registry/mocks/Limiter.go @@ -0,0 +1,46 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + + time "time" +) + +// Limiter is an autogenerated mock type for the Limiter type +type Limiter struct { + mock.Mock +} + +// Take provides a mock function with given fields: +func (_m *Limiter) Take() time.Time { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Take") + } + + var r0 time.Time + if rf, ok := ret.Get(0).(func() time.Time); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Time) + } + + return r0 +} + +// NewLimiter creates a new instance of Limiter. 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 NewLimiter(t interface { + mock.TestingT + Cleanup(func()) +}) *Limiter { + mock := &Limiter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/registry-scanner/pkg/registry/mocks/Manager.go b/registry-scanner/pkg/registry/mocks/Manager.go new file mode 100644 index 0000000..02c3776 --- /dev/null +++ b/registry-scanner/pkg/registry/mocks/Manager.go @@ -0,0 +1,80 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + http "net/http" + + challenge "github.com/distribution/distribution/v3/registry/client/auth/challenge" + + mock "github.com/stretchr/testify/mock" + + url "net/url" +) + +// Manager is an autogenerated mock type for the Manager type +type Manager struct { + mock.Mock +} + +// AddResponse provides a mock function with given fields: resp +func (_m *Manager) AddResponse(resp *http.Response) error { + ret := _m.Called(resp) + + if len(ret) == 0 { + panic("no return value specified for AddResponse") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*http.Response) error); ok { + r0 = rf(resp) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GetChallenges provides a mock function with given fields: endpoint +func (_m *Manager) GetChallenges(endpoint url.URL) ([]challenge.Challenge, error) { + ret := _m.Called(endpoint) + + if len(ret) == 0 { + panic("no return value specified for GetChallenges") + } + + var r0 []challenge.Challenge + var r1 error + if rf, ok := ret.Get(0).(func(url.URL) ([]challenge.Challenge, error)); ok { + return rf(endpoint) + } + if rf, ok := ret.Get(0).(func(url.URL) []challenge.Challenge); ok { + r0 = rf(endpoint) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]challenge.Challenge) + } + } + + if rf, ok := ret.Get(1).(func(url.URL) error); ok { + r1 = rf(endpoint) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewManager creates a new instance of Manager. 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 NewManager(t interface { + mock.TestingT + Cleanup(func()) +}) *Manager { + mock := &Manager{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/registry-scanner/pkg/registry/mocks/Manifest.go b/registry-scanner/pkg/registry/mocks/Manifest.go new file mode 100644 index 0000000..8b92f36 --- /dev/null +++ b/registry-scanner/pkg/registry/mocks/Manifest.go @@ -0,0 +1,84 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + distribution "github.com/distribution/distribution/v3" + mock "github.com/stretchr/testify/mock" +) + +// Manifest is an autogenerated mock type for the Manifest type +type Manifest struct { + mock.Mock +} + +// Payload provides a mock function with given fields: +func (_m *Manifest) Payload() (string, []byte, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Payload") + } + + var r0 string + var r1 []byte + var r2 error + if rf, ok := ret.Get(0).(func() (string, []byte, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() []byte); ok { + r1 = rf() + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]byte) + } + } + + if rf, ok := ret.Get(2).(func() error); ok { + r2 = rf() + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// References provides a mock function with given fields: +func (_m *Manifest) References() []distribution.Descriptor { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for References") + } + + var r0 []distribution.Descriptor + if rf, ok := ret.Get(0).(func() []distribution.Descriptor); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]distribution.Descriptor) + } + } + + return r0 +} + +// NewManifest creates a new instance of Manifest. 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 NewManifest(t interface { + mock.TestingT + Cleanup(func()) +}) *Manifest { + mock := &Manifest{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/registry-scanner/pkg/registry/mocks/ManifestService.go b/registry-scanner/pkg/registry/mocks/ManifestService.go new file mode 100644 index 0000000..cb42e32 --- /dev/null +++ b/registry-scanner/pkg/registry/mocks/ManifestService.go @@ -0,0 +1,149 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + distribution "github.com/distribution/distribution/v3" + digest "github.com/opencontainers/go-digest" + + mock "github.com/stretchr/testify/mock" +) + +// ManifestService is an autogenerated mock type for the ManifestService type +type ManifestService struct { + mock.Mock +} + +// Delete provides a mock function with given fields: ctx, dgst +func (_m *ManifestService) Delete(ctx context.Context, dgst digest.Digest) error { + ret := _m.Called(ctx, dgst) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, digest.Digest) error); ok { + r0 = rf(ctx, dgst) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Exists provides a mock function with given fields: ctx, dgst +func (_m *ManifestService) Exists(ctx context.Context, dgst digest.Digest) (bool, error) { + ret := _m.Called(ctx, dgst) + + if len(ret) == 0 { + panic("no return value specified for Exists") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, digest.Digest) (bool, error)); ok { + return rf(ctx, dgst) + } + if rf, ok := ret.Get(0).(func(context.Context, digest.Digest) bool); ok { + r0 = rf(ctx, dgst) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, digest.Digest) error); ok { + r1 = rf(ctx, dgst) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Get provides a mock function with given fields: ctx, dgst, options +func (_m *ManifestService) Get(ctx context.Context, dgst digest.Digest, options ...distribution.ManifestServiceOption) (distribution.Manifest, error) { + _va := make([]interface{}, len(options)) + for _i := range options { + _va[_i] = options[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, dgst) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 distribution.Manifest + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, digest.Digest, ...distribution.ManifestServiceOption) (distribution.Manifest, error)); ok { + return rf(ctx, dgst, options...) + } + if rf, ok := ret.Get(0).(func(context.Context, digest.Digest, ...distribution.ManifestServiceOption) distribution.Manifest); ok { + r0 = rf(ctx, dgst, options...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(distribution.Manifest) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, digest.Digest, ...distribution.ManifestServiceOption) error); ok { + r1 = rf(ctx, dgst, options...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Put provides a mock function with given fields: ctx, manifest, options +func (_m *ManifestService) Put(ctx context.Context, manifest distribution.Manifest, options ...distribution.ManifestServiceOption) (digest.Digest, error) { + _va := make([]interface{}, len(options)) + for _i := range options { + _va[_i] = options[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, manifest) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Put") + } + + var r0 digest.Digest + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, distribution.Manifest, ...distribution.ManifestServiceOption) (digest.Digest, error)); ok { + return rf(ctx, manifest, options...) + } + if rf, ok := ret.Get(0).(func(context.Context, distribution.Manifest, ...distribution.ManifestServiceOption) digest.Digest); ok { + r0 = rf(ctx, manifest, options...) + } else { + r0 = ret.Get(0).(digest.Digest) + } + + if rf, ok := ret.Get(1).(func(context.Context, distribution.Manifest, ...distribution.ManifestServiceOption) error); ok { + r1 = rf(ctx, manifest, options...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewManifestService creates a new instance of ManifestService. 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 NewManifestService(t interface { + mock.TestingT + Cleanup(func()) +}) *ManifestService { + mock := &ManifestService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/registry-scanner/pkg/registry/mocks/RegistryClient.go b/registry-scanner/pkg/registry/mocks/RegistryClient.go new file mode 100644 index 0000000..2943b04 --- /dev/null +++ b/registry-scanner/pkg/registry/mocks/RegistryClient.go @@ -0,0 +1,125 @@ +// Code generated by mockery v1.1.2. DO NOT EDIT. + +package mocks + +import ( + distribution "github.com/distribution/distribution/v3" + digest "github.com/opencontainers/go-digest" + + mock "github.com/stretchr/testify/mock" + + options "github.com/argoproj-labs/argocd-image-updater/registry-scanner/pkg/options" + + tag "github.com/argoproj-labs/argocd-image-updater/registry-scanner/pkg/tag" +) + +// RegistryClient is an autogenerated mock type for the RegistryClient type +type RegistryClient struct { + mock.Mock +} + +// ManifestForDigest provides a mock function with given fields: dgst +func (_m *RegistryClient) ManifestForDigest(dgst digest.Digest) (distribution.Manifest, error) { + ret := _m.Called(dgst) + + var r0 distribution.Manifest + if rf, ok := ret.Get(0).(func(digest.Digest) distribution.Manifest); ok { + r0 = rf(dgst) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(distribution.Manifest) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(digest.Digest) error); ok { + r1 = rf(dgst) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ManifestForTag provides a mock function with given fields: tagStr +func (_m *RegistryClient) ManifestForTag(tagStr string) (distribution.Manifest, error) { + ret := _m.Called(tagStr) + + var r0 distribution.Manifest + if rf, ok := ret.Get(0).(func(string) distribution.Manifest); ok { + r0 = rf(tagStr) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(distribution.Manifest) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(tagStr) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewRepository provides a mock function with given fields: nameInRepository +func (_m *RegistryClient) NewRepository(nameInRepository string) error { + ret := _m.Called(nameInRepository) + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(nameInRepository) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// TagMetadata provides a mock function with given fields: manifest, opts +func (_m *RegistryClient) TagMetadata(manifest distribution.Manifest, opts *options.ManifestOptions) (*tag.TagInfo, error) { + ret := _m.Called(manifest, opts) + + var r0 *tag.TagInfo + if rf, ok := ret.Get(0).(func(distribution.Manifest, *options.ManifestOptions) *tag.TagInfo); ok { + r0 = rf(manifest, opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*tag.TagInfo) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(distribution.Manifest, *options.ManifestOptions) error); ok { + r1 = rf(manifest, opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Tags provides a mock function with given fields: +func (_m *RegistryClient) Tags() ([]string, error) { + ret := _m.Called() + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/registry-scanner/pkg/registry/mocks/Repository.go b/registry-scanner/pkg/registry/mocks/Repository.go new file mode 100644 index 0000000..04d9b7c --- /dev/null +++ b/registry-scanner/pkg/registry/mocks/Repository.go @@ -0,0 +1,128 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + distribution "github.com/distribution/distribution/v3" + mock "github.com/stretchr/testify/mock" + + reference "github.com/distribution/distribution/v3/reference" +) + +// Repository is an autogenerated mock type for the Repository type +type Repository struct { + mock.Mock +} + +// Blobs provides a mock function with given fields: ctx +func (_m *Repository) Blobs(ctx context.Context) distribution.BlobStore { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Blobs") + } + + var r0 distribution.BlobStore + if rf, ok := ret.Get(0).(func(context.Context) distribution.BlobStore); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(distribution.BlobStore) + } + } + + return r0 +} + +// Manifests provides a mock function with given fields: ctx, options +func (_m *Repository) Manifests(ctx context.Context, options ...distribution.ManifestServiceOption) (distribution.ManifestService, error) { + _va := make([]interface{}, len(options)) + for _i := range options { + _va[_i] = options[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Manifests") + } + + var r0 distribution.ManifestService + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ...distribution.ManifestServiceOption) (distribution.ManifestService, error)); ok { + return rf(ctx, options...) + } + if rf, ok := ret.Get(0).(func(context.Context, ...distribution.ManifestServiceOption) distribution.ManifestService); ok { + r0 = rf(ctx, options...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(distribution.ManifestService) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ...distribution.ManifestServiceOption) error); ok { + r1 = rf(ctx, options...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Named provides a mock function with given fields: +func (_m *Repository) Named() reference.Named { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Named") + } + + var r0 reference.Named + if rf, ok := ret.Get(0).(func() reference.Named); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(reference.Named) + } + } + + return r0 +} + +// Tags provides a mock function with given fields: ctx +func (_m *Repository) Tags(ctx context.Context) distribution.TagService { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Tags") + } + + var r0 distribution.TagService + if rf, ok := ret.Get(0).(func(context.Context) distribution.TagService); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(distribution.TagService) + } + } + + return r0 +} + +// NewRepository creates a new instance of Repository. 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 NewRepository(t interface { + mock.TestingT + Cleanup(func()) +}) *Repository { + mock := &Repository{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/registry-scanner/pkg/registry/mocks/RoundTripper.go b/registry-scanner/pkg/registry/mocks/RoundTripper.go new file mode 100644 index 0000000..27e22c2 --- /dev/null +++ b/registry-scanner/pkg/registry/mocks/RoundTripper.go @@ -0,0 +1,58 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + http "net/http" + + mock "github.com/stretchr/testify/mock" +) + +// RoundTripper is an autogenerated mock type for the RoundTripper type +type RoundTripper struct { + mock.Mock +} + +// RoundTrip provides a mock function with given fields: _a0 +func (_m *RoundTripper) RoundTrip(_a0 *http.Request) (*http.Response, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for RoundTrip") + } + + var r0 *http.Response + var r1 error + if rf, ok := ret.Get(0).(func(*http.Request) (*http.Response, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(*http.Request) *http.Response); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + + if rf, ok := ret.Get(1).(func(*http.Request) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewRoundTripper creates a new instance of RoundTripper. 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 NewRoundTripper(t interface { + mock.TestingT + Cleanup(func()) +}) *RoundTripper { + mock := &RoundTripper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/registry-scanner/pkg/registry/mocks/TagService.go b/registry-scanner/pkg/registry/mocks/TagService.go new file mode 100644 index 0000000..5037808 --- /dev/null +++ b/registry-scanner/pkg/registry/mocks/TagService.go @@ -0,0 +1,153 @@ +// Code generated by mockery v2.43.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + distribution "github.com/distribution/distribution/v3" + mock "github.com/stretchr/testify/mock" +) + +// TagService is an autogenerated mock type for the TagService type +type TagService struct { + mock.Mock +} + +// All provides a mock function with given fields: ctx +func (_m *TagService) All(ctx context.Context) ([]string, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for All") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) []string); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Get provides a mock function with given fields: ctx, tag +func (_m *TagService) Get(ctx context.Context, tag string) (distribution.Descriptor, error) { + ret := _m.Called(ctx, tag) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 distribution.Descriptor + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (distribution.Descriptor, error)); ok { + return rf(ctx, tag) + } + if rf, ok := ret.Get(0).(func(context.Context, string) distribution.Descriptor); ok { + r0 = rf(ctx, tag) + } else { + r0 = ret.Get(0).(distribution.Descriptor) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, tag) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Lookup provides a mock function with given fields: ctx, digest +func (_m *TagService) Lookup(ctx context.Context, digest distribution.Descriptor) ([]string, error) { + ret := _m.Called(ctx, digest) + + if len(ret) == 0 { + panic("no return value specified for Lookup") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, distribution.Descriptor) ([]string, error)); ok { + return rf(ctx, digest) + } + if rf, ok := ret.Get(0).(func(context.Context, distribution.Descriptor) []string); ok { + r0 = rf(ctx, digest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, distribution.Descriptor) error); ok { + r1 = rf(ctx, digest) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Tag provides a mock function with given fields: ctx, tag, desc +func (_m *TagService) Tag(ctx context.Context, tag string, desc distribution.Descriptor) error { + ret := _m.Called(ctx, tag, desc) + + if len(ret) == 0 { + panic("no return value specified for Tag") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, distribution.Descriptor) error); ok { + r0 = rf(ctx, tag, desc) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Untag provides a mock function with given fields: ctx, tag +func (_m *TagService) Untag(ctx context.Context, tag string) error { + ret := _m.Called(ctx, tag) + + if len(ret) == 0 { + panic("no return value specified for Untag") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, tag) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// NewTagService creates a new instance of TagService. 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 NewTagService(t interface { + mock.TestingT + Cleanup(func()) +}) *TagService { + mock := &TagService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} |
