testhelpers

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAnnotation

func AssertAnnotation(t *testing.T, annotation string, expected string, objectMeta metav1.ObjectMeta, kindMessage string)

AssertAnnotation asserts the object has the given annotation value

func AssertFileNotExists added in v0.0.18

func AssertFileNotExists(t *testing.T, path string)

AssertFileNotExists asserts that a file does not exist

func AssertLabel

func AssertLabel(t *testing.T, label string, expected string, objectMeta metav1.ObjectMeta, kindMessage string)

AssertLabel asserts the object has the given label value

func AssertSecretData

func AssertSecretData(t *testing.T, key string, expected string, secret *corev1.Secret, kindMessage string)

AssertLabel asserts the object has the given label value

func AssertTextFilesEqual

func AssertTextFilesEqual(t *testing.T, expected string, actual string, message string)

AssertTextFilesEqual asserts that the expected file matches the actual file contents

func AssertYamlEqual

func AssertYamlEqual(t *testing.T, expected string, actual string, message string, args ...interface{})

AssertYamlEqual validates YAML without worrying about ordering of keys

func ObjectNameMessage

func ObjectNameMessage(objectMeta metav1.ObjectMeta, kindMessage string) string

ObjectNameMessage returns an object name message used in the tests

Types

type FakeResult

type FakeResult struct {
	CLI string
	Dir string
}

FakeResult the expected results

type FakeRunner

type FakeRunner struct {
	Commands     []*util.Command
	ResultOutput string
	ResultError  error
}

FakeRunner for testing command runners

func (*FakeRunner) ExpectResults

func (f *FakeRunner) ExpectResults(t *testing.T, results ...FakeResult)

Expects expects the given results

func (*FakeRunner) Run

func (f *FakeRunner) Run(c *util.Command) (string, error)

Run the default implementation

Jump to

Keyboard shortcuts

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