resttest

package
v1.1.5-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignFunc added in v1.1.0

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

type EmitFunc added in v1.1.0

type EmitFunc func(runtime.Object, string) error

type GetFunc added in v1.1.0

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

type InitWatchFunc added in v1.1.0

type InitWatchFunc func()

type InjectErrFunc added in v1.1.0

type InjectErrFunc func(err error)

type IsErrorFunc added in v1.1.0

type IsErrorFunc func(err error) bool

type SetFunc added in v1.1.0

type SetFunc func(api.Context, runtime.Object) error

type SetRVFunc added in v1.1.0

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, storageError injectErrorFunc) *Tester

func (*Tester) AllowCreateOnUpdate added in v1.1.0

func (t *Tester) AllowCreateOnUpdate() *Tester

func (*Tester) ClusterScope

func (t *Tester) ClusterScope() *Tester

func (*Tester) GeneratesName added in v1.1.0

func (t *Tester) GeneratesName() *Tester

func (*Tester) ReturnDeletedObject added in v1.1.0

func (t *Tester) ReturnDeletedObject() *Tester

func (*Tester) TestContext added in v0.18.0

func (t *Tester) TestContext() api.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, setFn SetFunc, getFn GetFunc, invalid ...runtime.Object)

Test creating an object.

func (*Tester) TestDelete added in v0.14.0

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

Test deleting an object.

func (*Tester) TestDeleteGraceful added in v0.14.0

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

Test gracefully deleting an object.

func (*Tester) TestGet added in v1.1.0

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

Test getting object.

func (*Tester) TestList added in v1.1.0

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

Test listing objects.

func (*Tester) TestNamespace added in v0.18.0

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 added in v0.16.0

func (t *Tester) TestUpdate(valid runtime.Object, setFn SetFunc, setRVFn SetRVFunc, getFn GetFunc, updateFn UpdateFunc, invalidUpdateFn ...UpdateFunc)

Test updating an object.

func (*Tester) TestWatch added in v1.1.0

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

Test watching objects.

type UpdateFunc added in v1.1.0

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