mirror of
https://github.com/harness/drone.git
synced 2025-05-03 12:00:49 +08:00

* fix merge conflicts * fix merge conflicts * fix review comment * fix review comment * fix review comment * fix: [AH-771]: gitness unit test refactoring * fix: [AH-771]: resolved review comments * fix: [AH-771]: resolved review comments * fix: [AH-771] Registry test refactoring and improvements - Refactored registry metadata test implementations - Improved code organization and readability - Fixed line length issues in test files - Removed unused fields from request.go - Added proper license headers - Fixed linting issues in mock files - Simplified test setup and assertions - Updated wire generation for cmd package - Added nolint:exhaustive directive for package type switch fix: [AH-771] Registry test refactoring and improvements - Refactored registry metadata test implementations - Improved code organization and readability - Fixed line length issues in test files - Removed unused fields from request.go - Added proper license headers - Fixed linting issues in mock files - Simplifi
101 lines
2.9 KiB
Go
101 lines
2.9 KiB
Go
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
multipart "mime/multipart"
|
|
|
|
pkgpython "github.com/harness/gitness/registry/app/api/controller/pkg/python"
|
|
python "github.com/harness/gitness/registry/app/pkg/types/python"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// Controller is an autogenerated mock type for the Controller type
|
|
type Controller struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// DownloadPackageFile provides a mock function with given fields: ctx, info
|
|
func (_m *Controller) DownloadPackageFile(ctx context.Context, info python.ArtifactInfo) *pkgpython.GetArtifactResponse {
|
|
ret := _m.Called(ctx, info)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DownloadPackageFile")
|
|
}
|
|
|
|
var r0 *pkgpython.GetArtifactResponse
|
|
if rf, ok := ret.Get(0).(func(context.Context, python.ArtifactInfo) *pkgpython.GetArtifactResponse); ok {
|
|
r0 = rf(ctx, info)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*pkgpython.GetArtifactResponse)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// GetPackageMetadata provides a mock function with given fields: ctx, info
|
|
func (_m *Controller) GetPackageMetadata(ctx context.Context, info python.ArtifactInfo) (python.PackageMetadata, error) {
|
|
ret := _m.Called(ctx, info)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetPackageMetadata")
|
|
}
|
|
|
|
var r0 python.PackageMetadata
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, python.ArtifactInfo) (python.PackageMetadata, error)); ok {
|
|
return rf(ctx, info)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, python.ArtifactInfo) python.PackageMetadata); ok {
|
|
r0 = rf(ctx, info)
|
|
} else {
|
|
r0 = ret.Get(0).(python.PackageMetadata)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, python.ArtifactInfo) error); ok {
|
|
r1 = rf(ctx, info)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UploadPackageFile provides a mock function with given fields: ctx, info, file, fileHeader
|
|
func (_m *Controller) UploadPackageFile(ctx context.Context, info python.ArtifactInfo, file multipart.File, fileHeader *multipart.FileHeader) *pkgpython.PutArtifactResponse {
|
|
ret := _m.Called(ctx, info, file, fileHeader)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UploadPackageFile")
|
|
}
|
|
|
|
var r0 *pkgpython.PutArtifactResponse
|
|
if rf, ok := ret.Get(0).(func(context.Context, python.ArtifactInfo, multipart.File, *multipart.FileHeader) *pkgpython.PutArtifactResponse); ok {
|
|
r0 = rf(ctx, info, file, fileHeader)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*pkgpython.PutArtifactResponse)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NewController creates a new instance of Controller. 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 NewController(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *Controller {
|
|
mock := &Controller{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|