fakes

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobCacheMock

type JobCacheMock struct {
	// AddIndexerFunc mocks the AddIndexer method.
	AddIndexerFunc func(indexName string, indexer v1.JobIndexer)

	// GetFunc mocks the Get method.
	GetFunc func(namespace string, name string) (*v1a.Job, error)

	// GetByIndexFunc mocks the GetByIndex method.
	GetByIndexFunc func(indexName string, key string) ([]*v1a.Job, error)

	// ListFunc mocks the List method.
	ListFunc func(namespace string, selector labels.Selector) ([]*v1a.Job, error)
	// contains filtered or unexported fields
}

JobCacheMock is a mock implementation of JobCache.

    func TestSomethingThatUsesJobCache(t *testing.T) {

        // make and configure a mocked JobCache
        mockedJobCache := &JobCacheMock{
            AddIndexerFunc: func(indexName string, indexer v1.JobIndexer)  {
	               panic("mock out the AddIndexer method")
            },
            GetFunc: func(namespace string, name string) (*v1a.Job, error) {
	               panic("mock out the Get method")
            },
            GetByIndexFunc: func(indexName string, key string) ([]*v1a.Job, error) {
	               panic("mock out the GetByIndex method")
            },
            ListFunc: func(namespace string, selector labels.Selector) ([]*v1a.Job, error) {
	               panic("mock out the List method")
            },
        }

        // use mockedJobCache in code that requires JobCache
        // and then make assertions.

    }

func (*JobCacheMock) AddIndexer

func (mock *JobCacheMock) AddIndexer(indexName string, indexer v1.JobIndexer)

AddIndexer calls AddIndexerFunc.

func (*JobCacheMock) AddIndexerCalls

func (mock *JobCacheMock) AddIndexerCalls() []struct {
	IndexName string
	Indexer   v1.JobIndexer
}

AddIndexerCalls gets all the calls that were made to AddIndexer. Check the length with:

len(mockedJobCache.AddIndexerCalls())

func (*JobCacheMock) Get

func (mock *JobCacheMock) Get(namespace string, name string) (*v1a.Job, error)

Get calls GetFunc.

func (*JobCacheMock) GetByIndex

func (mock *JobCacheMock) GetByIndex(indexName string, key string) ([]*v1a.Job, error)

GetByIndex calls GetByIndexFunc.

func (*JobCacheMock) GetByIndexCalls

func (mock *JobCacheMock) GetByIndexCalls() []struct {
	IndexName string
	Key       string
}

GetByIndexCalls gets all the calls that were made to GetByIndex. Check the length with:

len(mockedJobCache.GetByIndexCalls())

func (*JobCacheMock) GetCalls

func (mock *JobCacheMock) GetCalls() []struct {
	Namespace string
	Name      string
}

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

len(mockedJobCache.GetCalls())

func (*JobCacheMock) List

func (mock *JobCacheMock) List(namespace string, selector labels.Selector) ([]*v1a.Job, error)

List calls ListFunc.

func (*JobCacheMock) ListCalls

func (mock *JobCacheMock) ListCalls() []struct {
	Namespace string
	Selector  labels.Selector
}

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

len(mockedJobCache.ListCalls())

type JobClientMock

type JobClientMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(in1 *v1a.Job) (*v1a.Job, error)

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(namespace string, name string, options *v1b.DeleteOptions) error

	// GetFunc mocks the Get method.
	GetFunc func(namespace string, name string, options v1b.GetOptions) (*v1a.Job, error)

	// ListFunc mocks the List method.
	ListFunc func(namespace string, opts v1b.ListOptions) (*v1a.JobList, error)

	// PatchFunc mocks the Patch method.
	PatchFunc func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Job, error)

	// UpdateFunc mocks the Update method.
	UpdateFunc func(in1 *v1a.Job) (*v1a.Job, error)

	// UpdateStatusFunc mocks the UpdateStatus method.
	UpdateStatusFunc func(in1 *v1a.Job) (*v1a.Job, error)

	// WatchFunc mocks the Watch method.
	WatchFunc func(namespace string, opts v1b.ListOptions) (watch.Interface, error)
	// contains filtered or unexported fields
}

JobClientMock is a mock implementation of JobClient.

    func TestSomethingThatUsesJobClient(t *testing.T) {

        // make and configure a mocked JobClient
        mockedJobClient := &JobClientMock{
            CreateFunc: func(in1 *v1a.Job) (*v1a.Job, error) {
	               panic("mock out the Create method")
            },
            DeleteFunc: func(namespace string, name string, options *v1b.DeleteOptions) error {
	               panic("mock out the Delete method")
            },
            GetFunc: func(namespace string, name string, options v1b.GetOptions) (*v1a.Job, error) {
	               panic("mock out the Get method")
            },
            ListFunc: func(namespace string, opts v1b.ListOptions) (*v1a.JobList, error) {
	               panic("mock out the List method")
            },
            PatchFunc: func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Job, error) {
	               panic("mock out the Patch method")
            },
            UpdateFunc: func(in1 *v1a.Job) (*v1a.Job, error) {
	               panic("mock out the Update method")
            },
            UpdateStatusFunc: func(in1 *v1a.Job) (*v1a.Job, error) {
	               panic("mock out the UpdateStatus method")
            },
            WatchFunc: func(namespace string, opts v1b.ListOptions) (watch.Interface, error) {
	               panic("mock out the Watch method")
            },
        }

        // use mockedJobClient in code that requires JobClient
        // and then make assertions.

    }

func (*JobClientMock) Create

func (mock *JobClientMock) Create(in1 *v1a.Job) (*v1a.Job, error)

Create calls CreateFunc.

func (*JobClientMock) CreateCalls

func (mock *JobClientMock) CreateCalls() []struct {
	In1 *v1a.Job
}

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

len(mockedJobClient.CreateCalls())

func (*JobClientMock) Delete

func (mock *JobClientMock) Delete(namespace string, name string, options *v1b.DeleteOptions) error

Delete calls DeleteFunc.

func (*JobClientMock) DeleteCalls

func (mock *JobClientMock) DeleteCalls() []struct {
	Namespace string
	Name      string
	Options   *v1b.DeleteOptions
}

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

len(mockedJobClient.DeleteCalls())

func (*JobClientMock) Get

func (mock *JobClientMock) Get(namespace string, name string, options v1b.GetOptions) (*v1a.Job, error)

Get calls GetFunc.

func (*JobClientMock) GetCalls

func (mock *JobClientMock) GetCalls() []struct {
	Namespace string
	Name      string
	Options   v1b.GetOptions
}

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

len(mockedJobClient.GetCalls())

func (*JobClientMock) List

func (mock *JobClientMock) List(namespace string, opts v1b.ListOptions) (*v1a.JobList, error)

List calls ListFunc.

func (*JobClientMock) ListCalls

func (mock *JobClientMock) ListCalls() []struct {
	Namespace string
	Opts      v1b.ListOptions
}

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

len(mockedJobClient.ListCalls())

func (*JobClientMock) Patch

func (mock *JobClientMock) Patch(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Job, error)

Patch calls PatchFunc.

func (*JobClientMock) PatchCalls

func (mock *JobClientMock) PatchCalls() []struct {
	Namespace    string
	Name         string
	Pt           types.PatchType
	Data         []byte
	Subresources []string
}

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

len(mockedJobClient.PatchCalls())

func (*JobClientMock) Update

func (mock *JobClientMock) Update(in1 *v1a.Job) (*v1a.Job, error)

Update calls UpdateFunc.

func (*JobClientMock) UpdateCalls

func (mock *JobClientMock) UpdateCalls() []struct {
	In1 *v1a.Job
}

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

len(mockedJobClient.UpdateCalls())

func (*JobClientMock) UpdateStatus

func (mock *JobClientMock) UpdateStatus(in1 *v1a.Job) (*v1a.Job, error)

UpdateStatus calls UpdateStatusFunc.

func (*JobClientMock) UpdateStatusCalls

func (mock *JobClientMock) UpdateStatusCalls() []struct {
	In1 *v1a.Job
}

UpdateStatusCalls gets all the calls that were made to UpdateStatus. Check the length with:

len(mockedJobClient.UpdateStatusCalls())

func (*JobClientMock) Watch

func (mock *JobClientMock) Watch(namespace string, opts v1b.ListOptions) (watch.Interface, error)

Watch calls WatchFunc.

func (*JobClientMock) WatchCalls

func (mock *JobClientMock) WatchCalls() []struct {
	Namespace string
	Opts      v1b.ListOptions
}

WatchCalls gets all the calls that were made to Watch. Check the length with:

len(mockedJobClient.WatchCalls())

type JobControllerMock

type JobControllerMock struct {
	// AddGenericHandlerFunc mocks the AddGenericHandler method.
	AddGenericHandlerFunc func(ctx context.Context, name string, handler generic.Handler)

	// AddGenericRemoveHandlerFunc mocks the AddGenericRemoveHandler method.
	AddGenericRemoveHandlerFunc func(ctx context.Context, name string, handler generic.Handler)

	// CacheFunc mocks the Cache method.
	CacheFunc func() v1.JobCache

	// CreateFunc mocks the Create method.
	CreateFunc func(in1 *v1a.Job) (*v1a.Job, error)

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(namespace string, name string, options *v1b.DeleteOptions) error

	// EnqueueFunc mocks the Enqueue method.
	EnqueueFunc func(namespace string, name string)

	// GetFunc mocks the Get method.
	GetFunc func(namespace string, name string, options v1b.GetOptions) (*v1a.Job, error)

	// GroupVersionKindFunc mocks the GroupVersionKind method.
	GroupVersionKindFunc func() schema.GroupVersionKind

	// InformerFunc mocks the Informer method.
	InformerFunc func() cache.SharedIndexInformer

	// ListFunc mocks the List method.
	ListFunc func(namespace string, opts v1b.ListOptions) (*v1a.JobList, error)

	// OnChangeFunc mocks the OnChange method.
	OnChangeFunc func(ctx context.Context, name string, sync v1.JobHandler)

	// OnRemoveFunc mocks the OnRemove method.
	OnRemoveFunc func(ctx context.Context, name string, sync v1.JobHandler)

	// PatchFunc mocks the Patch method.
	PatchFunc func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Job, error)

	// UpdateFunc mocks the Update method.
	UpdateFunc func(in1 *v1a.Job) (*v1a.Job, error)

	// UpdateStatusFunc mocks the UpdateStatus method.
	UpdateStatusFunc func(in1 *v1a.Job) (*v1a.Job, error)

	// UpdaterFunc mocks the Updater method.
	UpdaterFunc func() generic.Updater

	// WatchFunc mocks the Watch method.
	WatchFunc func(namespace string, opts v1b.ListOptions) (watch.Interface, error)
	// contains filtered or unexported fields
}

JobControllerMock is a mock implementation of JobController.

    func TestSomethingThatUsesJobController(t *testing.T) {

        // make and configure a mocked JobController
        mockedJobController := &JobControllerMock{
            AddGenericHandlerFunc: func(ctx context.Context, name string, handler generic.Handler)  {
	               panic("mock out the AddGenericHandler method")
            },
            AddGenericRemoveHandlerFunc: func(ctx context.Context, name string, handler generic.Handler)  {
	               panic("mock out the AddGenericRemoveHandler method")
            },
            CacheFunc: func() v1.JobCache {
	               panic("mock out the Cache method")
            },
            CreateFunc: func(in1 *v1a.Job) (*v1a.Job, error) {
	               panic("mock out the Create method")
            },
            DeleteFunc: func(namespace string, name string, options *v1b.DeleteOptions) error {
	               panic("mock out the Delete method")
            },
            EnqueueFunc: func(namespace string, name string)  {
	               panic("mock out the Enqueue method")
            },
            GetFunc: func(namespace string, name string, options v1b.GetOptions) (*v1a.Job, error) {
	               panic("mock out the Get method")
            },
            GroupVersionKindFunc: func() schema.GroupVersionKind {
	               panic("mock out the GroupVersionKind method")
            },
            InformerFunc: func() cache.SharedIndexInformer {
	               panic("mock out the Informer method")
            },
            ListFunc: func(namespace string, opts v1b.ListOptions) (*v1a.JobList, error) {
	               panic("mock out the List method")
            },
            OnChangeFunc: func(ctx context.Context, name string, sync v1.JobHandler)  {
	               panic("mock out the OnChange method")
            },
            OnRemoveFunc: func(ctx context.Context, name string, sync v1.JobHandler)  {
	               panic("mock out the OnRemove method")
            },
            PatchFunc: func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Job, error) {
	               panic("mock out the Patch method")
            },
            UpdateFunc: func(in1 *v1a.Job) (*v1a.Job, error) {
	               panic("mock out the Update method")
            },
            UpdateStatusFunc: func(in1 *v1a.Job) (*v1a.Job, error) {
	               panic("mock out the UpdateStatus method")
            },
            UpdaterFunc: func() generic.Updater {
	               panic("mock out the Updater method")
            },
            WatchFunc: func(namespace string, opts v1b.ListOptions) (watch.Interface, error) {
	               panic("mock out the Watch method")
            },
        }

        // use mockedJobController in code that requires JobController
        // and then make assertions.

    }

func (*JobControllerMock) AddGenericHandler

func (mock *JobControllerMock) AddGenericHandler(ctx context.Context, name string, handler generic.Handler)

AddGenericHandler calls AddGenericHandlerFunc.

func (*JobControllerMock) AddGenericHandlerCalls

func (mock *JobControllerMock) AddGenericHandlerCalls() []struct {
	Ctx     context.Context
	Name    string
	Handler generic.Handler
}

AddGenericHandlerCalls gets all the calls that were made to AddGenericHandler. Check the length with:

len(mockedJobController.AddGenericHandlerCalls())

func (*JobControllerMock) AddGenericRemoveHandler

func (mock *JobControllerMock) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler)

AddGenericRemoveHandler calls AddGenericRemoveHandlerFunc.

func (*JobControllerMock) AddGenericRemoveHandlerCalls

func (mock *JobControllerMock) AddGenericRemoveHandlerCalls() []struct {
	Ctx     context.Context
	Name    string
	Handler generic.Handler
}

AddGenericRemoveHandlerCalls gets all the calls that were made to AddGenericRemoveHandler. Check the length with:

len(mockedJobController.AddGenericRemoveHandlerCalls())

func (*JobControllerMock) Cache

func (mock *JobControllerMock) Cache() v1.JobCache

Cache calls CacheFunc.

func (*JobControllerMock) CacheCalls

func (mock *JobControllerMock) CacheCalls() []struct {
}

CacheCalls gets all the calls that were made to Cache. Check the length with:

len(mockedJobController.CacheCalls())

func (*JobControllerMock) Create

func (mock *JobControllerMock) Create(in1 *v1a.Job) (*v1a.Job, error)

Create calls CreateFunc.

func (*JobControllerMock) CreateCalls

func (mock *JobControllerMock) CreateCalls() []struct {
	In1 *v1a.Job
}

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

len(mockedJobController.CreateCalls())

func (*JobControllerMock) Delete

func (mock *JobControllerMock) Delete(namespace string, name string, options *v1b.DeleteOptions) error

Delete calls DeleteFunc.

func (*JobControllerMock) DeleteCalls

func (mock *JobControllerMock) DeleteCalls() []struct {
	Namespace string
	Name      string
	Options   *v1b.DeleteOptions
}

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

len(mockedJobController.DeleteCalls())

func (*JobControllerMock) Enqueue

func (mock *JobControllerMock) Enqueue(namespace string, name string)

Enqueue calls EnqueueFunc.

func (*JobControllerMock) EnqueueCalls

func (mock *JobControllerMock) EnqueueCalls() []struct {
	Namespace string
	Name      string
}

EnqueueCalls gets all the calls that were made to Enqueue. Check the length with:

len(mockedJobController.EnqueueCalls())

func (*JobControllerMock) Get

func (mock *JobControllerMock) Get(namespace string, name string, options v1b.GetOptions) (*v1a.Job, error)

Get calls GetFunc.

func (*JobControllerMock) GetCalls

func (mock *JobControllerMock) GetCalls() []struct {
	Namespace string
	Name      string
	Options   v1b.GetOptions
}

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

len(mockedJobController.GetCalls())

func (*JobControllerMock) GroupVersionKind

func (mock *JobControllerMock) GroupVersionKind() schema.GroupVersionKind

GroupVersionKind calls GroupVersionKindFunc.

func (*JobControllerMock) GroupVersionKindCalls

func (mock *JobControllerMock) GroupVersionKindCalls() []struct {
}

GroupVersionKindCalls gets all the calls that were made to GroupVersionKind. Check the length with:

len(mockedJobController.GroupVersionKindCalls())

func (*JobControllerMock) Informer

func (mock *JobControllerMock) Informer() cache.SharedIndexInformer

Informer calls InformerFunc.

func (*JobControllerMock) InformerCalls

func (mock *JobControllerMock) InformerCalls() []struct {
}

InformerCalls gets all the calls that were made to Informer. Check the length with:

len(mockedJobController.InformerCalls())

func (*JobControllerMock) List

func (mock *JobControllerMock) List(namespace string, opts v1b.ListOptions) (*v1a.JobList, error)

List calls ListFunc.

func (*JobControllerMock) ListCalls

func (mock *JobControllerMock) ListCalls() []struct {
	Namespace string
	Opts      v1b.ListOptions
}

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

len(mockedJobController.ListCalls())

func (*JobControllerMock) OnChange

func (mock *JobControllerMock) OnChange(ctx context.Context, name string, sync v1.JobHandler)

OnChange calls OnChangeFunc.

func (*JobControllerMock) OnChangeCalls

func (mock *JobControllerMock) OnChangeCalls() []struct {
	Ctx  context.Context
	Name string
	Sync v1.JobHandler
}

OnChangeCalls gets all the calls that were made to OnChange. Check the length with:

len(mockedJobController.OnChangeCalls())

func (*JobControllerMock) OnRemove

func (mock *JobControllerMock) OnRemove(ctx context.Context, name string, sync v1.JobHandler)

OnRemove calls OnRemoveFunc.

func (*JobControllerMock) OnRemoveCalls

func (mock *JobControllerMock) OnRemoveCalls() []struct {
	Ctx  context.Context
	Name string
	Sync v1.JobHandler
}

OnRemoveCalls gets all the calls that were made to OnRemove. Check the length with:

len(mockedJobController.OnRemoveCalls())

func (*JobControllerMock) Patch

func (mock *JobControllerMock) Patch(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Job, error)

Patch calls PatchFunc.

func (*JobControllerMock) PatchCalls

func (mock *JobControllerMock) PatchCalls() []struct {
	Namespace    string
	Name         string
	Pt           types.PatchType
	Data         []byte
	Subresources []string
}

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

len(mockedJobController.PatchCalls())

func (*JobControllerMock) Update

func (mock *JobControllerMock) Update(in1 *v1a.Job) (*v1a.Job, error)

Update calls UpdateFunc.

func (*JobControllerMock) UpdateCalls

func (mock *JobControllerMock) UpdateCalls() []struct {
	In1 *v1a.Job
}

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

len(mockedJobController.UpdateCalls())

func (*JobControllerMock) UpdateStatus

func (mock *JobControllerMock) UpdateStatus(in1 *v1a.Job) (*v1a.Job, error)

UpdateStatus calls UpdateStatusFunc.

func (*JobControllerMock) UpdateStatusCalls

func (mock *JobControllerMock) UpdateStatusCalls() []struct {
	In1 *v1a.Job
}

UpdateStatusCalls gets all the calls that were made to UpdateStatus. Check the length with:

len(mockedJobController.UpdateStatusCalls())

func (*JobControllerMock) Updater

func (mock *JobControllerMock) Updater() generic.Updater

Updater calls UpdaterFunc.

func (*JobControllerMock) UpdaterCalls

func (mock *JobControllerMock) UpdaterCalls() []struct {
}

UpdaterCalls gets all the calls that were made to Updater. Check the length with:

len(mockedJobController.UpdaterCalls())

func (*JobControllerMock) Watch

func (mock *JobControllerMock) Watch(namespace string, opts v1b.ListOptions) (watch.Interface, error)

Watch calls WatchFunc.

func (*JobControllerMock) WatchCalls

func (mock *JobControllerMock) WatchCalls() []struct {
	Namespace string
	Opts      v1b.ListOptions
}

WatchCalls gets all the calls that were made to Watch. Check the length with:

len(mockedJobController.WatchCalls())

Jump to

Keyboard shortcuts

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