testutil

package
v0.106.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Fixtures embed.FS

Functions

func Capitalize

func Capitalize(s string) string

Capitalize capitalizes the first letter of a UTF-8 string.

func MakeCopyFunc

func MakeCopyFunc(ctx context.Context, fsys fs.FS, tempDir string) fs.WalkDirFunc

func SetupPlatform

func SetupPlatform(t testing.TB, apiVersion string) (tempDir string)

Types

type ComponentHarness

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

func NewComponentHarness

func NewComponentHarness(t testing.TB, tempDir, apiVersion string) *ComponentHarness

func (*ComponentHarness) AbsBase

func (h *ComponentHarness) AbsBase() string

AbsBase returns the absolute path to the api version base.

func (*ComponentHarness) Base

func (h *ComponentHarness) Base() string

Base returns the fixture base path relative to the root, for example "fixtures/v1alpha6"

func (*ComponentHarness) Component

func (h *ComponentHarness) Component(path string) *component.Component

Component returns a new component with fully qualified path filepath.Join(root, base, path).

func (*ComponentHarness) Ctx

func (h *ComponentHarness) Ctx() context.Context

func (*ComponentHarness) Load

func (h *ComponentHarness) Load(path string) (any, error)

Load unmarshals the first document in yaml or json path relative to the harness root.

func (*ComponentHarness) Root

func (h *ComponentHarness) Root() string

Jump to

Keyboard shortcuts

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