mirror of
https://github.com/harness/drone.git
synced 2025-05-03 14:59:42 +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
103 lines
2.3 KiB
Go
103 lines
2.3 KiB
Go
package mocks
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/harness/gitness/types"
|
|
|
|
"github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// SpacePathStore is a mock of SpacePathStore interface.
|
|
type SpacePathStore struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// FindByPath provides a mock function
|
|
func (m *SpacePathStore) FindByPath(ctx context.Context, path string) (*types.SpacePath, error) {
|
|
ret := m.Called(ctx, path)
|
|
|
|
var r0 *types.SpacePath
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *types.SpacePath); ok {
|
|
r0 = rf(ctx, path)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.SpacePath)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, path)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// FindPrimaryBySpaceID provides a mock function
|
|
func (m *SpacePathStore) FindPrimaryBySpaceID(ctx context.Context, spaceID int64) (*types.SpacePath, error) {
|
|
ret := m.Called(ctx, spaceID)
|
|
|
|
var r0 *types.SpacePath
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) *types.SpacePath); ok {
|
|
r0 = rf(ctx, spaceID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.SpacePath)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
|
|
r1 = rf(ctx, spaceID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// InsertSegment provides a mock function
|
|
func (m *SpacePathStore) InsertSegment(ctx context.Context, segment *types.SpacePathSegment) error {
|
|
ret := m.Called(ctx, segment)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *types.SpacePathSegment) error); ok {
|
|
r0 = rf(ctx, segment)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// DeletePrimarySegment provides a mock function
|
|
func (m *SpacePathStore) DeletePrimarySegment(ctx context.Context, spaceID int64) error {
|
|
ret := m.Called(ctx, spaceID)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
|
|
r0 = rf(ctx, spaceID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// DeletePathsAndDescendandPaths provides a mock function
|
|
func (m *SpacePathStore) DeletePathsAndDescendandPaths(ctx context.Context, spaceID int64) error {
|
|
ret := m.Called(ctx, spaceID)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
|
|
r0 = rf(ctx, spaceID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|