fake

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SigsClientInterface

type SigsClientInterface interface {
	k8sclient.Reader
	k8sclient.Writer
	k8sclient.StatusClient
	GetSigsClient() k8sclient.Client
	Scheme() *runtime.Scheme
	RESTMapper() meta.RESTMapper
}

type SigsClientInterfaceMock

type SigsClientInterfaceMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.CreateOption) error

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.DeleteOption) error

	// DeleteAllOfFunc mocks the DeleteAllOf method.
	DeleteAllOfFunc func(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.DeleteAllOfOption) error

	// GetFunc mocks the Get method.
	GetFunc func(ctx context.Context, key types.NamespacedName, obj k8sclient.Object) error

	// GetSigsClientFunc mocks the GetSigsClient method.
	GetSigsClientFunc func() k8sclient.Client

	// ListFunc mocks the List method.
	ListFunc func(ctx context.Context, list k8sclient.ObjectList, opts ...k8sclient.ListOption) error

	// PatchFunc mocks the Patch method.
	PatchFunc func(ctx context.Context, obj k8sclient.Object, patch k8sclient.Patch, opts ...k8sclient.PatchOption) error

	// RESTMapperFunc mocks the RESTMapper method.
	RESTMapperFunc func() meta.RESTMapper

	// SchemeFunc mocks the Scheme method.
	SchemeFunc func() *runtime.Scheme

	// StatusFunc mocks the Status method.
	StatusFunc func() k8sclient.StatusWriter

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.UpdateOption) error
	// contains filtered or unexported fields
}

SigsClientInterfaceMock is a mock implementation of SigsClientInterface.

func TestSomethingThatUsesSigsClientInterface(t *testing.T) {

	// make and configure a mocked SigsClientInterface
	mockedSigsClientInterface := &SigsClientInterfaceMock{
		CreateFunc: func(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.CreateOption) error {
			panic("mock out the Create method")
		},
		DeleteFunc: func(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.DeleteOption) error {
			panic("mock out the Delete method")
		},
		DeleteAllOfFunc: func(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.DeleteAllOfOption) error {
			panic("mock out the DeleteAllOf method")
		},
		GetFunc: func(ctx context.Context, key types.NamespacedName, obj k8sclient.Object) error {
			panic("mock out the Get method")
		},
		GetSigsClientFunc: func() k8sclient.Client {
			panic("mock out the GetSigsClient method")
		},
		ListFunc: func(ctx context.Context, list k8sclient.ObjectList, opts ...k8sclient.ListOption) error {
			panic("mock out the List method")
		},
		PatchFunc: func(ctx context.Context, obj k8sclient.Object, patch k8sclient.Patch, opts ...k8sclient.PatchOption) error {
			panic("mock out the Patch method")
		},
		RESTMapperFunc: func() meta.RESTMapper {
			panic("mock out the RESTMapper method")
		},
		SchemeFunc: func() *runtime.Scheme {
			panic("mock out the Scheme method")
		},
		StatusFunc: func() k8sclient.StatusWriter {
			panic("mock out the Status method")
		},
		UpdateFunc: func(ctx context.Context, obj k8sclient.Object, opts ...k8sclient.UpdateOption) error {
			panic("mock out the Update method")
		},
	}

	// use mockedSigsClientInterface in code that requires SigsClientInterface
	// and then make assertions.

}

func NewSigsClientMoqWithScheme

func NewSigsClientMoqWithScheme(clientScheme *runtime.Scheme, initObjs ...runtime.Object) *SigsClientInterfaceMock

func (*SigsClientInterfaceMock) Create

Create calls CreateFunc.

func (*SigsClientInterfaceMock) CreateCalls

func (mock *SigsClientInterfaceMock) CreateCalls() []struct {
	Ctx  context.Context
	Obj  k8sclient.Object
	Opts []k8sclient.CreateOption
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedSigsClientInterface.CreateCalls())

func (*SigsClientInterfaceMock) Delete

Delete calls DeleteFunc.

func (*SigsClientInterfaceMock) DeleteAllOf

DeleteAllOf calls DeleteAllOfFunc.

func (*SigsClientInterfaceMock) DeleteAllOfCalls

func (mock *SigsClientInterfaceMock) DeleteAllOfCalls() []struct {
	Ctx  context.Context
	Obj  k8sclient.Object
	Opts []k8sclient.DeleteAllOfOption
}

DeleteAllOfCalls gets all the calls that were made to DeleteAllOf. Check the length with:

len(mockedSigsClientInterface.DeleteAllOfCalls())

func (*SigsClientInterfaceMock) DeleteCalls

func (mock *SigsClientInterfaceMock) DeleteCalls() []struct {
	Ctx  context.Context
	Obj  k8sclient.Object
	Opts []k8sclient.DeleteOption
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedSigsClientInterface.DeleteCalls())

func (*SigsClientInterfaceMock) Get

Get calls GetFunc.

func (*SigsClientInterfaceMock) GetCalls

func (mock *SigsClientInterfaceMock) GetCalls() []struct {
	Ctx context.Context
	Key types.NamespacedName
	Obj k8sclient.Object
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedSigsClientInterface.GetCalls())

func (*SigsClientInterfaceMock) GetSigsClient

func (mock *SigsClientInterfaceMock) GetSigsClient() k8sclient.Client

GetSigsClient calls GetSigsClientFunc.

func (*SigsClientInterfaceMock) GetSigsClientCalls

func (mock *SigsClientInterfaceMock) GetSigsClientCalls() []struct {
}

GetSigsClientCalls gets all the calls that were made to GetSigsClient. Check the length with:

len(mockedSigsClientInterface.GetSigsClientCalls())

func (*SigsClientInterfaceMock) List

List calls ListFunc.

func (*SigsClientInterfaceMock) ListCalls

func (mock *SigsClientInterfaceMock) ListCalls() []struct {
	Ctx  context.Context
	List k8sclient.ObjectList
	Opts []k8sclient.ListOption
}

ListCalls gets all the calls that were made to List. Check the length with:

len(mockedSigsClientInterface.ListCalls())

func (*SigsClientInterfaceMock) Patch

Patch calls PatchFunc.

func (*SigsClientInterfaceMock) PatchCalls

func (mock *SigsClientInterfaceMock) PatchCalls() []struct {
	Ctx   context.Context
	Obj   k8sclient.Object
	Patch k8sclient.Patch
	Opts  []k8sclient.PatchOption
}

PatchCalls gets all the calls that were made to Patch. Check the length with:

len(mockedSigsClientInterface.PatchCalls())

func (*SigsClientInterfaceMock) RESTMapper added in v0.42.0

func (mock *SigsClientInterfaceMock) RESTMapper() meta.RESTMapper

RESTMapper calls RESTMapperFunc.

func (*SigsClientInterfaceMock) RESTMapperCalls added in v0.42.0

func (mock *SigsClientInterfaceMock) RESTMapperCalls() []struct {
}

RESTMapperCalls gets all the calls that were made to RESTMapper. Check the length with:

len(mockedSigsClientInterface.RESTMapperCalls())

func (*SigsClientInterfaceMock) Scheme added in v0.42.0

func (mock *SigsClientInterfaceMock) Scheme() *runtime.Scheme

Scheme calls SchemeFunc.

func (*SigsClientInterfaceMock) SchemeCalls added in v0.42.0

func (mock *SigsClientInterfaceMock) SchemeCalls() []struct {
}

SchemeCalls gets all the calls that were made to Scheme. Check the length with:

len(mockedSigsClientInterface.SchemeCalls())

func (*SigsClientInterfaceMock) Status

Status calls StatusFunc.

func (*SigsClientInterfaceMock) StatusCalls

func (mock *SigsClientInterfaceMock) StatusCalls() []struct {
}

StatusCalls gets all the calls that were made to Status. Check the length with:

len(mockedSigsClientInterface.StatusCalls())

func (*SigsClientInterfaceMock) Update

Update calls UpdateFunc.

func (*SigsClientInterfaceMock) UpdateCalls

func (mock *SigsClientInterfaceMock) UpdateCalls() []struct {
	Ctx  context.Context
	Obj  k8sclient.Object
	Opts []k8sclient.UpdateOption
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedSigsClientInterface.UpdateCalls())

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL