harbor/src/testing/pkg/quota/driver/driver.go

158 lines
3.6 KiB
Go

// Code generated by mockery v2.42.2. DO NOT EDIT.
package driver
import (
context "context"
driver "github.com/goharbor/harbor/src/pkg/quota/driver"
mock "github.com/stretchr/testify/mock"
types "github.com/goharbor/harbor/src/pkg/quota/types"
)
// Driver is an autogenerated mock type for the Driver type
type Driver struct {
mock.Mock
}
// CalculateUsage provides a mock function with given fields: ctx, key
func (_m *Driver) CalculateUsage(ctx context.Context, key string) (types.ResourceList, error) {
ret := _m.Called(ctx, key)
if len(ret) == 0 {
panic("no return value specified for CalculateUsage")
}
var r0 types.ResourceList
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (types.ResourceList, error)); ok {
return rf(ctx, key)
}
if rf, ok := ret.Get(0).(func(context.Context, string) types.ResourceList); ok {
r0 = rf(ctx, key)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.ResourceList)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, key)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Enabled provides a mock function with given fields: ctx, key
func (_m *Driver) Enabled(ctx context.Context, key string) (bool, error) {
ret := _m.Called(ctx, key)
if len(ret) == 0 {
panic("no return value specified for Enabled")
}
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok {
return rf(ctx, key)
}
if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok {
r0 = rf(ctx, key)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, key)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// HardLimits provides a mock function with given fields: ctx
func (_m *Driver) HardLimits(ctx context.Context) types.ResourceList {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for HardLimits")
}
var r0 types.ResourceList
if rf, ok := ret.Get(0).(func(context.Context) types.ResourceList); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.ResourceList)
}
}
return r0
}
// Load provides a mock function with given fields: ctx, key
func (_m *Driver) Load(ctx context.Context, key string) (driver.RefObject, error) {
ret := _m.Called(ctx, key)
if len(ret) == 0 {
panic("no return value specified for Load")
}
var r0 driver.RefObject
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (driver.RefObject, error)); ok {
return rf(ctx, key)
}
if rf, ok := ret.Get(0).(func(context.Context, string) driver.RefObject); ok {
r0 = rf(ctx, key)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(driver.RefObject)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, key)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Validate provides a mock function with given fields: hardLimits
func (_m *Driver) Validate(hardLimits types.ResourceList) error {
ret := _m.Called(hardLimits)
if len(ret) == 0 {
panic("no return value specified for Validate")
}
var r0 error
if rf, ok := ret.Get(0).(func(types.ResourceList) error); ok {
r0 = rf(hardLimits)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewDriver creates a new instance of Driver. 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 NewDriver(t interface {
mock.TestingT
Cleanup(func())
}) *Driver {
mock := &Driver{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}