resttest

package
v0.31.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignFunc

type AssignFunc func([]runtime.Object) []runtime.Object

type CreateFunc

type CreateFunc func(context.Context, runtime.Object) error

type EmitFunc

type EmitFunc func(runtime.Object, string) error

type GetFunc

type GetFunc func(context.Context, runtime.Object) (runtime.Object, error)

type InitWatchFunc

type InitWatchFunc func()

type InjectErrFunc

type InjectErrFunc func(err error)

type IsErrorFunc

type IsErrorFunc func(err error) bool

type SetRVFunc

type SetRVFunc func(uint64)

type Tester

type Tester struct {
	*testing.T
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, storage rest.Storage) *Tester

func (*Tester) AllowCreateOnUpdate

func (t *Tester) AllowCreateOnUpdate() *Tester

func (*Tester) ClusterScope

func (t *Tester) ClusterScope() *Tester

func (*Tester) GeneratesName

func (t *Tester) GeneratesName() *Tester

func (*Tester) Namer

func (t *Tester) Namer(namer func(int) string) *Tester

Namer allows providing a custom name maker By default "foo%d" is used

func (*Tester) ReturnDeletedObject

func (t *Tester) ReturnDeletedObject() *Tester

func (*Tester) TestContext

func (t *Tester) TestContext() context.Context

TestContext returns a namespaced context that will be used when making storage calls. Namespace is determined by TestNamespace()

func (*Tester) TestCreate

func (t *Tester) TestCreate(valid runtime.Object, createFn CreateFunc, getFn GetFunc, invalid ...runtime.Object)

Test creating an object.

func (*Tester) TestDelete

func (t *Tester) TestDelete(valid runtime.Object, createFn CreateFunc, getFn GetFunc, isNotFoundFn IsErrorFunc)

Test deleting an object.

func (*Tester) TestDeleteGraceful

func (t *Tester) TestDeleteGraceful(valid runtime.Object, createFn CreateFunc, getFn GetFunc, expectedGrace int64)

Test gracefully deleting an object.

func (*Tester) TestGet

func (t *Tester) TestGet(valid runtime.Object)

Test getting object.

func (*Tester) TestList

func (t *Tester) TestList(valid runtime.Object, assignFn AssignFunc)

Test listing objects.

func (*Tester) TestNamespace

func (t *Tester) TestNamespace() string

TestNamespace returns the namespace that will be used when creating contexts. Returns NamespaceNone for cluster-scoped objects.

func (*Tester) TestUpdate

func (t *Tester) TestUpdate(valid runtime.Object, createFn CreateFunc, getFn GetFunc, updateFn UpdateFunc, invalidUpdateFn ...UpdateFunc)

Test updating an object.

func (*Tester) TestWatch

func (t *Tester) TestWatch(
	valid runtime.Object, emitFn EmitFunc,
	labelsPass, labelsFail []labels.Set, fieldsPass, fieldsFail []fields.Set, actions []string)

Test watching objects.

type UpdateFunc

type UpdateFunc func(runtime.Object) runtime.Object

Jump to

Keyboard shortcuts

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