testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Scheme = runtime.NewScheme()

Scheme stores necessary schemes for testing. nolint: gochecknoglobals

Functions

func AssetBinPath added in v0.2.0

func AssetBinPath(name string) string

func CompareMultiStrings added in v0.2.0

func CompareMultiStrings(strs ...string) int

func MapObjects added in v0.2.0

func MapObjects(input []runtime.Object, fn func(runtime.Object)) []runtime.Object

func NewEnvironment added in v0.2.0

func NewEnvironment() testenv.Interface

func ProjectDir added in v0.2.0

func ProjectDir() string

func RestoreNamespace added in v0.2.0

func RestoreNamespace(m *Map, input []runtime.Object) []runtime.Object

func RunSpecs

func RunSpecs(t *testing.T, desc string)

func SetRandomNamespace added in v0.2.0

func SetRandomNamespace(m *Map, input []runtime.Object) []runtime.Object

func SortObjects added in v0.2.0

func SortObjects(objects []runtime.Object)

Types

type Client added in v0.2.0

type Client struct {
	client.Client
	// contains filtered or unexported fields
}

func NewClient added in v0.2.0

func NewClient(env testenv.Interface, objects ...runtime.Object) *Client

func (*Client) Create added in v0.2.0

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

func (*Client) GetChangedObjects added in v0.2.0

func (c *Client) GetChangedObjects() []runtime.Object

func (*Client) Patch added in v0.2.0

func (c *Client) Patch(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOptionFunc) error

func (*Client) Reset added in v0.2.0

func (c *Client) Reset()

func (*Client) Update added in v0.2.0

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

type Map added in v0.2.0

type Map struct {
	// contains filtered or unexported fields
}

func NewMap added in v0.2.0

func NewMap() *Map

func (*Map) Key added in v0.2.0

func (m *Map) Key(value string) string

func (*Map) Set added in v0.2.0

func (m *Map) Set(key, value string) (string, bool)

func (*Map) Value added in v0.2.0

func (m *Map) Value(key string) string

type ObjectSlice added in v0.2.0

type ObjectSlice []runtime.Object

func (ObjectSlice) Len added in v0.2.0

func (o ObjectSlice) Len() int

func (ObjectSlice) Less added in v0.2.0

func (o ObjectSlice) Less(i, j int) bool

func (ObjectSlice) Swap added in v0.2.0

func (o ObjectSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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