testing

package
v0.15.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAction

func AssertAction(t *testing.T, actual clienttesting.Action, expected string)

func AssertActions

func AssertActions(t *testing.T, actualActions []clienttesting.Action, expectedVerbs ...string)

AssertActions asserts the actual actions have the expected action verb

func AssertCondition

func AssertCondition(
	t *testing.T,
	actualConditions []metav1.Condition,
	expectedCondition metav1.Condition)

AssertCondition asserts the actual conditions has the expected condition

func AssertDelete

func AssertDelete(t *testing.T, actual clienttesting.Action, resource, namespace, name string)

func AssertEqualNameNamespace

func AssertEqualNameNamespace(t *testing.T, actualName, actualNamespace, name, namespace string)

func AssertEqualNumber

func AssertEqualNumber(t *testing.T, actual, expected int)

func AssertError

func AssertError(t *testing.T, actual error, expectedErr string)

AssertError asserts the actual error representation is the same with the expected, if the expected error representation is empty, the actual should be nil

func AssertErrorWithPrefix

func AssertErrorWithPrefix(t *testing.T, actual error, expectedErrorPrefix string)

AssertError asserts the actual error representation starts with the expected prerfix, if the expected error prefix is empty, the actual should be nil

func AssertGet

func AssertGet(t *testing.T, actual clienttesting.Action, group, version, resource string)

func AssertNoActions

func AssertNoActions(t *testing.T, actualActions []clienttesting.Action)

AssertNoActions asserts no actions are happened

func AssertNoMoreUpdates

func AssertNoMoreUpdates(t *testing.T, actions []clienttesting.Action)

AssertNoMoreUpdates asserts only one update action in given actions

func AssertUpdateActions

func AssertUpdateActions(t *testing.T, actions []clienttesting.Action)

AssertUpdateActions asserts the actions are get-then-update action

func NewUnstructured added in v0.14.0

func NewUnstructured(apiVersion, kind, namespace, name string, owners ...metav1.OwnerReference) *unstructured.Unstructured

func NewUnstructuredSecret added in v0.14.0

func NewUnstructuredSecret(namespace, name string, terminated bool, uid string, owners ...metav1.OwnerReference) *unstructured.Unstructured

func NewUnstructuredWithContent added in v0.14.0

func NewUnstructuredWithContent(
	apiVersion, kind, namespace, name string, content map[string]interface{}) *unstructured.Unstructured

Types

type FakeSyncContext

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

func NewFakeSyncContext

func NewFakeSyncContext(t *testing.T, clusterName string) *FakeSyncContext

func (FakeSyncContext) Queue

func (FakeSyncContext) QueueKey

func (f FakeSyncContext) QueueKey() string

func (FakeSyncContext) Recorder

func (f FakeSyncContext) Recorder() events.Recorder

Jump to

Keyboard shortcuts

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