test

package
v0.0.0-...-732e647 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestType = "TEST_TYPE"
	E2e      = "E2E"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeClient

type FakeClient struct {
	client.Client
	T                *testing.T
	MockGet          func(ctx context.Context, key client.ObjectKey, obj runtime.Object) error
	MockList         func(ctx context.Context, list runtime.Object, opts ...client.ListOption) error
	MockCreate       func(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error
	MockUpdate       func(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error
	MockPatch        func(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error
	MockStatusUpdate func(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error
	MockStatusPatch  func(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error
	MockDelete       func(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error
	MockDeleteAllOf  func(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error
}

func NewFakeClient

func NewFakeClient(t *testing.T, initObjs ...runtime.Object) *FakeClient

NewFakeClient creates a fake K8s client with ability to override specific Get/List/Create/Update/StatusUpdate/Delete functions

func (*FakeClient) Create

func (c *FakeClient) Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error

func (*FakeClient) Delete

func (c *FakeClient) Delete(ctx context.Context, obj runtime.Object, opts ...client.DeleteOption) error

func (*FakeClient) DeleteAllOf

func (c *FakeClient) DeleteAllOf(ctx context.Context, obj runtime.Object, opts ...client.DeleteAllOfOption) error

func (*FakeClient) Get

func (c *FakeClient) Get(ctx context.Context, key client.ObjectKey, obj runtime.Object) error

func (*FakeClient) List

func (c *FakeClient) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error

func (*FakeClient) Status

func (c *FakeClient) Status() client.StatusWriter

func (*FakeClient) Update

func (c *FakeClient) Update(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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