2022-08-31 22:36:32 +00:00
// Code generated by mockery v2.14.0. DO NOT EDIT.
2021-09-28 10:56:59 +00:00
package mocks
import (
context "context"
http "net/http"
mock "github.com/stretchr/testify/mock"
model "github.com/woodpecker-ci/woodpecker/server/model"
2022-01-03 14:33:36 +00:00
2021-09-28 10:56:59 +00:00
remote "github.com/woodpecker-ci/woodpecker/server/remote"
)
// Remote is an autogenerated mock type for the Remote type
type Remote struct {
mock . Mock
}
// Activate provides a mock function with given fields: ctx, u, r, link
func ( _m * Remote ) Activate ( ctx context . Context , u * model . User , r * model . Repo , link string ) error {
ret := _m . Called ( ctx , u , r , link )
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , * model . Repo , string ) error ) ; ok {
r0 = rf ( ctx , u , r , link )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
// Auth provides a mock function with given fields: ctx, token, secret
func ( _m * Remote ) Auth ( ctx context . Context , token string , secret string ) ( string , error ) {
ret := _m . Called ( ctx , token , secret )
var r0 string
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string , string ) string ) ; ok {
r0 = rf ( ctx , token , secret )
} else {
r0 = ret . Get ( 0 ) . ( string )
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string , string ) error ) ; ok {
r1 = rf ( ctx , token , secret )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-08-31 22:36:32 +00:00
// BranchHead provides a mock function with given fields: ctx, u, r, branch
func ( _m * Remote ) BranchHead ( ctx context . Context , u * model . User , r * model . Repo , branch string ) ( string , error ) {
ret := _m . Called ( ctx , u , r , branch )
var r0 string
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , * model . Repo , string ) string ) ; ok {
r0 = rf ( ctx , u , r , branch )
} else {
r0 = ret . Get ( 0 ) . ( string )
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * model . User , * model . Repo , string ) error ) ; ok {
r1 = rf ( ctx , u , r , branch )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-10-27 00:47:55 +00:00
// Branches provides a mock function with given fields: ctx, u, r
func ( _m * Remote ) Branches ( ctx context . Context , u * model . User , r * model . Repo ) ( [ ] string , error ) {
ret := _m . Called ( ctx , u , r )
var r0 [ ] string
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , * model . Repo ) [ ] string ) ; ok {
r0 = rf ( ctx , u , r )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] string )
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * model . User , * model . Repo ) error ) ; ok {
r1 = rf ( ctx , u , r )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2021-09-28 10:56:59 +00:00
// Deactivate provides a mock function with given fields: ctx, u, r, link
func ( _m * Remote ) Deactivate ( ctx context . Context , u * model . User , r * model . Repo , link string ) error {
ret := _m . Called ( ctx , u , r , link )
var r0 error
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , * model . Repo , string ) error ) ; ok {
r0 = rf ( ctx , u , r , link )
} else {
r0 = ret . Error ( 0 )
}
return r0
}
// Dir provides a mock function with given fields: ctx, u, r, b, f
func ( _m * Remote ) Dir ( ctx context . Context , u * model . User , r * model . Repo , b * model . Build , f string ) ( [ ] * remote . FileMeta , error ) {
ret := _m . Called ( ctx , u , r , b , f )
var r0 [ ] * remote . FileMeta
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , * model . Repo , * model . Build , string ) [ ] * remote . FileMeta ) ; ok {
r0 = rf ( ctx , u , r , b , f )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] * remote . FileMeta )
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * model . User , * model . Repo , * model . Build , string ) error ) ; ok {
r1 = rf ( ctx , u , r , b , f )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
// File provides a mock function with given fields: ctx, u, r, b, f
func ( _m * Remote ) File ( ctx context . Context , u * model . User , r * model . Repo , b * model . Build , f string ) ( [ ] byte , error ) {
ret := _m . Called ( ctx , u , r , b , f )
var r0 [ ] byte
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , * model . Repo , * model . Build , string ) [ ] byte ) ; ok {
r0 = rf ( ctx , u , r , b , f )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] byte )
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * model . User , * model . Repo , * model . Build , string ) error ) ; ok {
r1 = rf ( ctx , u , r , b , f )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-01-17 22:46:59 +00:00
// Hook provides a mock function with given fields: ctx, r
func ( _m * Remote ) Hook ( ctx context . Context , r * http . Request ) ( * model . Repo , * model . Build , error ) {
ret := _m . Called ( ctx , r )
2021-09-28 10:56:59 +00:00
var r0 * model . Repo
2022-01-17 22:46:59 +00:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * http . Request ) * model . Repo ) ; ok {
r0 = rf ( ctx , r )
2021-09-28 10:56:59 +00:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * model . Repo )
}
}
var r1 * model . Build
2022-01-17 22:46:59 +00:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * http . Request ) * model . Build ) ; ok {
r1 = rf ( ctx , r )
2021-09-28 10:56:59 +00:00
} else {
if ret . Get ( 1 ) != nil {
r1 = ret . Get ( 1 ) . ( * model . Build )
}
}
var r2 error
2022-01-17 22:46:59 +00:00
if rf , ok := ret . Get ( 2 ) . ( func ( context . Context , * http . Request ) error ) ; ok {
r2 = rf ( ctx , r )
2021-09-28 10:56:59 +00:00
} else {
r2 = ret . Error ( 2 )
}
return r0 , r1 , r2
}
// Login provides a mock function with given fields: ctx, w, r
func ( _m * Remote ) Login ( ctx context . Context , w http . ResponseWriter , r * http . Request ) ( * model . User , error ) {
ret := _m . Called ( ctx , w , r )
var r0 * model . User
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , http . ResponseWriter , * http . Request ) * model . User ) ; ok {
r0 = rf ( ctx , w , r )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * model . User )
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , http . ResponseWriter , * http . Request ) error ) ; ok {
r1 = rf ( ctx , w , r )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-06-17 18:14:01 +00:00
// Name provides a mock function with given fields:
func ( _m * Remote ) Name ( ) string {
ret := _m . Called ( )
var r0 string
if rf , ok := ret . Get ( 0 ) . ( func ( ) string ) ; ok {
r0 = rf ( )
} else {
r0 = ret . Get ( 0 ) . ( string )
}
return r0
}
2021-09-28 10:56:59 +00:00
// Netrc provides a mock function with given fields: u, r
func ( _m * Remote ) Netrc ( u * model . User , r * model . Repo ) ( * model . Netrc , error ) {
ret := _m . Called ( u , r )
var r0 * model . Netrc
if rf , ok := ret . Get ( 0 ) . ( func ( * model . User , * model . Repo ) * model . Netrc ) ; ok {
r0 = rf ( u , r )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * model . Netrc )
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( * model . User , * model . Repo ) error ) ; ok {
r1 = rf ( u , r )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-07-25 01:09:35 +00:00
// OrgMembership provides a mock function with given fields: ctx, u, owner
func ( _m * Remote ) OrgMembership ( ctx context . Context , u * model . User , owner string ) ( * model . OrgPerm , error ) {
ret := _m . Called ( ctx , u , owner )
var r0 * model . OrgPerm
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , string ) * model . OrgPerm ) ; ok {
r0 = rf ( ctx , u , owner )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * model . OrgPerm )
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * model . User , string ) error ) ; ok {
r1 = rf ( ctx , u , owner )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-01-03 14:33:36 +00:00
// Perm provides a mock function with given fields: ctx, u, r
func ( _m * Remote ) Perm ( ctx context . Context , u * model . User , r * model . Repo ) ( * model . Perm , error ) {
ret := _m . Called ( ctx , u , r )
2021-09-28 10:56:59 +00:00
var r0 * model . Perm
2022-01-03 14:33:36 +00:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , * model . Repo ) * model . Perm ) ; ok {
r0 = rf ( ctx , u , r )
2021-09-28 10:56:59 +00:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * model . Perm )
}
}
var r1 error
2022-01-03 14:33:36 +00:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * model . User , * model . Repo ) error ) ; ok {
r1 = rf ( ctx , u , r )
2021-09-28 10:56:59 +00:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-09-05 15:08:51 +00:00
// Repo provides a mock function with given fields: ctx, u, id, owner, name
func ( _m * Remote ) Repo ( ctx context . Context , u * model . User , id model . RemoteID , owner string , name string ) ( * model . Repo , error ) {
ret := _m . Called ( ctx , u , id , owner , name )
2021-09-28 10:56:59 +00:00
var r0 * model . Repo
2022-09-05 15:08:51 +00:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , model . RemoteID , string , string ) * model . Repo ) ; ok {
r0 = rf ( ctx , u , id , owner , name )
2021-09-28 10:56:59 +00:00
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * model . Repo )
}
}
var r1 error
2022-09-05 15:08:51 +00:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * model . User , model . RemoteID , string , string ) error ) ; ok {
r1 = rf ( ctx , u , id , owner , name )
2021-09-28 10:56:59 +00:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
// Repos provides a mock function with given fields: ctx, u
func ( _m * Remote ) Repos ( ctx context . Context , u * model . User ) ( [ ] * model . Repo , error ) {
ret := _m . Called ( ctx , u )
var r0 [ ] * model . Repo
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User ) [ ] * model . Repo ) ; ok {
r0 = rf ( ctx , u )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] * model . Repo )
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * model . User ) error ) ; ok {
r1 = rf ( ctx , u )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-01-03 14:33:36 +00:00
// Status provides a mock function with given fields: ctx, u, r, b, p
func ( _m * Remote ) Status ( ctx context . Context , u * model . User , r * model . Repo , b * model . Build , p * model . Proc ) error {
ret := _m . Called ( ctx , u , r , b , p )
2021-09-28 10:56:59 +00:00
var r0 error
2021-12-28 16:02:49 +00:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User , * model . Repo , * model . Build , * model . Proc ) error ) ; ok {
2022-01-03 14:33:36 +00:00
r0 = rf ( ctx , u , r , b , p )
2021-09-28 10:56:59 +00:00
} else {
r0 = ret . Error ( 0 )
}
return r0
}
// Teams provides a mock function with given fields: ctx, u
func ( _m * Remote ) Teams ( ctx context . Context , u * model . User ) ( [ ] * model . Team , error ) {
ret := _m . Called ( ctx , u )
var r0 [ ] * model . Team
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * model . User ) [ ] * model . Team ) ; ok {
r0 = rf ( ctx , u )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] * model . Team )
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * model . User ) error ) ; ok {
r1 = rf ( ctx , u )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-06-17 18:14:01 +00:00
type mockConstructorTestingTNewRemote interface {
mock . TestingT
Cleanup ( func ( ) )
}
// NewRemote creates a new instance of Remote. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewRemote ( t mockConstructorTestingTNewRemote ) * Remote {
mock := & Remote { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}