mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-04-21 02:46:56 -04:00
97 lines
2.5 KiB
Go
97 lines
2.5 KiB
Go
// Code generated by mockery v2.53.5. DO NOT EDIT.
|
|
|
|
package authz
|
|
|
|
import (
|
|
context "context"
|
|
|
|
"forgejo.org/models/perm"
|
|
repo_model "forgejo.org/models/repo"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
"xorm.io/builder"
|
|
)
|
|
|
|
// MockAuthorizationReducer is an autogenerated mock type for the AuthorizationReducer type
|
|
type MockAuthorizationReducer struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// AllowAdminOverride provides a mock function with no fields
|
|
func (_m *MockAuthorizationReducer) AllowAdminOverride() bool {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for AllowAdminOverride")
|
|
}
|
|
|
|
var r0 bool
|
|
if rf, ok := ret.Get(0).(func() bool); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// ReduceRepoAccess provides a mock function with given fields: ctx, repo, accessMode
|
|
func (_m *MockAuthorizationReducer) ReduceRepoAccess(ctx context.Context, repo *repo_model.Repository, accessMode perm.AccessMode) (perm.AccessMode, error) {
|
|
ret := _m.Called(ctx, repo, accessMode)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ReduceRepoAccess")
|
|
}
|
|
|
|
var r0 perm.AccessMode
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *repo_model.Repository, perm.AccessMode) (perm.AccessMode, error)); ok {
|
|
return rf(ctx, repo, accessMode)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *repo_model.Repository, perm.AccessMode) perm.AccessMode); ok {
|
|
r0 = rf(ctx, repo, accessMode)
|
|
} else {
|
|
r0 = ret.Get(0).(perm.AccessMode)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *repo_model.Repository, perm.AccessMode) error); ok {
|
|
r1 = rf(ctx, repo, accessMode)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// RepoFilter provides a mock function with given fields: accessMode
|
|
func (_m *MockAuthorizationReducer) RepoReadAccessFilter() builder.Cond {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for AllowAdminOverride")
|
|
}
|
|
|
|
var r0 builder.Cond
|
|
if rf, ok := ret.Get(0).(func() builder.Cond); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(builder.Cond)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NewMockAuthorizationReducer creates a new instance of MockAuthorizationReducer. 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 NewMockAuthorizationReducer(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
},
|
|
) *MockAuthorizationReducer {
|
|
mock := &MockAuthorizationReducer{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|