testutils

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Utility functions and constants for tests

Index

Constants

View Source
const (
	// Invalid resources names
	InvalidFolderPath  = "/invalid/path"
	InvalidFileName    = "invalid.yaml"
	InvalidGroupName   = "invalid-group"
	InvalidClusterName = "invalid-cluster"

	// Valid resources names
	TestGroupName1       = "test-group"
	TestGroupName2       = "test-group2"
	TestClusterName1     = "test-cluster"
	TestClusterName2     = "test-cluster2"
	KustomizeTestDirName = "kustomize-test"
)

Variables

This section is empty.

Functions

func CompareFile

func CompareFile(t *testing.T, fileContent []byte, filePath string)

func GetTestFile

func GetTestFile(module string, args ...string) string

func PrepareFakeWorktree

func PrepareFakeWorktree(t *testing.T) *billy.Filesystem

func PrepareWorktree

func PrepareWorktree(t *testing.T, fsType string) *billy.Filesystem

Types

type FakeFilesGetter

type FakeFilesGetter struct {
	Testing *testing.T
}

func (FakeFilesGetter) WorkTreeForPackage

func (filesGetter FakeFilesGetter) WorkTreeForPackage(pkg v1alpha1.Package) (*billy.Filesystem, error)

Jump to

Keyboard shortcuts

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