blob: 5dc93c83a525b7d7a0027375e1c63efbf0fc610f [file] [log] [blame]
// Code generated by mockery v0.0.0-dev. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
provider "go.skia.org/infra/perf/go/git/provider"
time "time"
types "go.skia.org/infra/perf/go/types"
)
// Git is an autogenerated mock type for the Git type
type Git struct {
mock.Mock
}
// CommitFromCommitNumber provides a mock function with given fields: ctx, commitNumber
func (_m *Git) CommitFromCommitNumber(ctx context.Context, commitNumber types.CommitNumber) (provider.Commit, error) {
ret := _m.Called(ctx, commitNumber)
if len(ret) == 0 {
panic("no return value specified for CommitFromCommitNumber")
}
var r0 provider.Commit
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) (provider.Commit, error)); ok {
return rf(ctx, commitNumber)
}
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) provider.Commit); ok {
r0 = rf(ctx, commitNumber)
} else {
r0 = ret.Get(0).(provider.Commit)
}
if rf, ok := ret.Get(1).(func(context.Context, types.CommitNumber) error); ok {
r1 = rf(ctx, commitNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CommitNumberFromGitHash provides a mock function with given fields: ctx, githash
func (_m *Git) CommitNumberFromGitHash(ctx context.Context, githash string) (types.CommitNumber, error) {
ret := _m.Called(ctx, githash)
if len(ret) == 0 {
panic("no return value specified for CommitNumberFromGitHash")
}
var r0 types.CommitNumber
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (types.CommitNumber, error)); ok {
return rf(ctx, githash)
}
if rf, ok := ret.Get(0).(func(context.Context, string) types.CommitNumber); ok {
r0 = rf(ctx, githash)
} else {
r0 = ret.Get(0).(types.CommitNumber)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, githash)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CommitNumberFromTime provides a mock function with given fields: ctx, t
func (_m *Git) CommitNumberFromTime(ctx context.Context, t time.Time) (types.CommitNumber, error) {
ret := _m.Called(ctx, t)
if len(ret) == 0 {
panic("no return value specified for CommitNumberFromTime")
}
var r0 types.CommitNumber
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, time.Time) (types.CommitNumber, error)); ok {
return rf(ctx, t)
}
if rf, ok := ret.Get(0).(func(context.Context, time.Time) types.CommitNumber); ok {
r0 = rf(ctx, t)
} else {
r0 = ret.Get(0).(types.CommitNumber)
}
if rf, ok := ret.Get(1).(func(context.Context, time.Time) error); ok {
r1 = rf(ctx, t)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CommitNumbersWhenFileChangesInCommitNumberRange provides a mock function with given fields: ctx, begin, end, filename
func (_m *Git) CommitNumbersWhenFileChangesInCommitNumberRange(ctx context.Context, begin types.CommitNumber, end types.CommitNumber, filename string) ([]types.CommitNumber, error) {
ret := _m.Called(ctx, begin, end, filename)
if len(ret) == 0 {
panic("no return value specified for CommitNumbersWhenFileChangesInCommitNumberRange")
}
var r0 []types.CommitNumber
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber, types.CommitNumber, string) ([]types.CommitNumber, error)); ok {
return rf(ctx, begin, end, filename)
}
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber, types.CommitNumber, string) []types.CommitNumber); ok {
r0 = rf(ctx, begin, end, filename)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]types.CommitNumber)
}
}
if rf, ok := ret.Get(1).(func(context.Context, types.CommitNumber, types.CommitNumber, string) error); ok {
r1 = rf(ctx, begin, end, filename)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CommitSliceFromCommitNumberRange provides a mock function with given fields: ctx, begin, end
func (_m *Git) CommitSliceFromCommitNumberRange(ctx context.Context, begin types.CommitNumber, end types.CommitNumber) ([]provider.Commit, error) {
ret := _m.Called(ctx, begin, end)
if len(ret) == 0 {
panic("no return value specified for CommitSliceFromCommitNumberRange")
}
var r0 []provider.Commit
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber, types.CommitNumber) ([]provider.Commit, error)); ok {
return rf(ctx, begin, end)
}
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber, types.CommitNumber) []provider.Commit); ok {
r0 = rf(ctx, begin, end)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]provider.Commit)
}
}
if rf, ok := ret.Get(1).(func(context.Context, types.CommitNumber, types.CommitNumber) error); ok {
r1 = rf(ctx, begin, end)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CommitSliceFromCommitNumberSlice provides a mock function with given fields: ctx, commitNumberSlice
func (_m *Git) CommitSliceFromCommitNumberSlice(ctx context.Context, commitNumberSlice []types.CommitNumber) ([]provider.Commit, error) {
ret := _m.Called(ctx, commitNumberSlice)
if len(ret) == 0 {
panic("no return value specified for CommitSliceFromCommitNumberSlice")
}
var r0 []provider.Commit
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []types.CommitNumber) ([]provider.Commit, error)); ok {
return rf(ctx, commitNumberSlice)
}
if rf, ok := ret.Get(0).(func(context.Context, []types.CommitNumber) []provider.Commit); ok {
r0 = rf(ctx, commitNumberSlice)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]provider.Commit)
}
}
if rf, ok := ret.Get(1).(func(context.Context, []types.CommitNumber) error); ok {
r1 = rf(ctx, commitNumberSlice)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CommitSliceFromTimeRange provides a mock function with given fields: ctx, begin, end
func (_m *Git) CommitSliceFromTimeRange(ctx context.Context, begin time.Time, end time.Time) ([]provider.Commit, error) {
ret := _m.Called(ctx, begin, end)
if len(ret) == 0 {
panic("no return value specified for CommitSliceFromTimeRange")
}
var r0 []provider.Commit
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, time.Time, time.Time) ([]provider.Commit, error)); ok {
return rf(ctx, begin, end)
}
if rf, ok := ret.Get(0).(func(context.Context, time.Time, time.Time) []provider.Commit); ok {
r0 = rf(ctx, begin, end)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]provider.Commit)
}
}
if rf, ok := ret.Get(1).(func(context.Context, time.Time, time.Time) error); ok {
r1 = rf(ctx, begin, end)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetCommitNumber provides a mock function with given fields: ctx, githash, commitNumber
func (_m *Git) GetCommitNumber(ctx context.Context, githash string, commitNumber types.CommitNumber) (types.CommitNumber, error) {
ret := _m.Called(ctx, githash, commitNumber)
if len(ret) == 0 {
panic("no return value specified for GetCommitNumber")
}
var r0 types.CommitNumber
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.CommitNumber) (types.CommitNumber, error)); ok {
return rf(ctx, githash, commitNumber)
}
if rf, ok := ret.Get(0).(func(context.Context, string, types.CommitNumber) types.CommitNumber); ok {
r0 = rf(ctx, githash, commitNumber)
} else {
r0 = ret.Get(0).(types.CommitNumber)
}
if rf, ok := ret.Get(1).(func(context.Context, string, types.CommitNumber) error); ok {
r1 = rf(ctx, githash, commitNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GitHashFromCommitNumber provides a mock function with given fields: ctx, commitNumber
func (_m *Git) GitHashFromCommitNumber(ctx context.Context, commitNumber types.CommitNumber) (string, error) {
ret := _m.Called(ctx, commitNumber)
if len(ret) == 0 {
panic("no return value specified for GitHashFromCommitNumber")
}
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) (string, error)); ok {
return rf(ctx, commitNumber)
}
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) string); ok {
r0 = rf(ctx, commitNumber)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, types.CommitNumber) error); ok {
r1 = rf(ctx, commitNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// LogEntry provides a mock function with given fields: ctx, commit
func (_m *Git) LogEntry(ctx context.Context, commit types.CommitNumber) (string, error) {
ret := _m.Called(ctx, commit)
if len(ret) == 0 {
panic("no return value specified for LogEntry")
}
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) (string, error)); ok {
return rf(ctx, commit)
}
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) string); ok {
r0 = rf(ctx, commit)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, types.CommitNumber) error); ok {
r1 = rf(ctx, commit)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PreviousCommitNumberFromCommitNumber provides a mock function with given fields: ctx, commitNumber
func (_m *Git) PreviousCommitNumberFromCommitNumber(ctx context.Context, commitNumber types.CommitNumber) (types.CommitNumber, error) {
ret := _m.Called(ctx, commitNumber)
if len(ret) == 0 {
panic("no return value specified for PreviousCommitNumberFromCommitNumber")
}
var r0 types.CommitNumber
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) (types.CommitNumber, error)); ok {
return rf(ctx, commitNumber)
}
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) types.CommitNumber); ok {
r0 = rf(ctx, commitNumber)
} else {
r0 = ret.Get(0).(types.CommitNumber)
}
if rf, ok := ret.Get(1).(func(context.Context, types.CommitNumber) error); ok {
r1 = rf(ctx, commitNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PreviousGitHashFromCommitNumber provides a mock function with given fields: ctx, commitNumber
func (_m *Git) PreviousGitHashFromCommitNumber(ctx context.Context, commitNumber types.CommitNumber) (string, error) {
ret := _m.Called(ctx, commitNumber)
if len(ret) == 0 {
panic("no return value specified for PreviousGitHashFromCommitNumber")
}
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) (string, error)); ok {
return rf(ctx, commitNumber)
}
if rf, ok := ret.Get(0).(func(context.Context, types.CommitNumber) string); ok {
r0 = rf(ctx, commitNumber)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, types.CommitNumber) error); ok {
r1 = rf(ctx, commitNumber)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RepoSuppliedCommitNumber provides a mock function with no fields
func (_m *Git) RepoSuppliedCommitNumber() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for RepoSuppliedCommitNumber")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// StartBackgroundPolling provides a mock function with given fields: ctx, duration
func (_m *Git) StartBackgroundPolling(ctx context.Context, duration time.Duration) {
_m.Called(ctx, duration)
}
// Update provides a mock function with given fields: ctx
func (_m *Git) Update(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Update")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewGit creates a new instance of Git. 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 NewGit(t interface {
mock.TestingT
Cleanup(func())
}) *Git {
mock := &Git{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}