testing

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 13 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 AssertFinalizers

func AssertFinalizers(t *testing.T, obj runtime.Object, finalizers []string)

AssertFinalizers asserts the given runtime object has the expected finalizers

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

func RemoveTempFile(file string) error

RemoveTempFile removes a temporary file if it exists.

func WriteToTempFile added in v0.15.0

func WriteToTempFile(pattern string, data []byte) (*os.File, error)

WriteToTempFile writes data to a temporary file in the default directory for temporary files with the provided pattern and returns the file and an error if any. The permissions of the file are set to 0644 by default.

Types

type ManagedClusterBuilder added in v1.0.0

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

func NewManagedCluster added in v1.0.0

func NewManagedCluster(clusterName string) *ManagedClusterBuilder

func (*ManagedClusterBuilder) Build added in v1.0.0

func (*ManagedClusterBuilder) WithClaim added in v1.0.0

func (b *ManagedClusterBuilder) WithClaim(name, value string) *ManagedClusterBuilder

func (*ManagedClusterBuilder) WithDeletionTimestamp added in v1.0.0

func (b *ManagedClusterBuilder) WithDeletionTimestamp() *ManagedClusterBuilder

func (*ManagedClusterBuilder) WithLabel added in v1.0.0

func (b *ManagedClusterBuilder) WithLabel(name, value string) *ManagedClusterBuilder

func (*ManagedClusterBuilder) WithResource added in v1.0.0

func (b *ManagedClusterBuilder) WithResource(resourceName clusterapiv1.ResourceName, allocatable, capacity string) *ManagedClusterBuilder

func (*ManagedClusterBuilder) WithTaint added in v1.0.0

Jump to

Keyboard shortcuts

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