v1alphatest

package
v0.90.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package v1alphatest provides test utilities specifically for v1alpha manifest validation. Since we want to test the validation of whole manifest.Object and not it's individual fields, duplicating logic for objects like v1alpha.Labels can be cumbersome and hard to maintain. This package solves the issue by defining a single source of truth for test cases for objects like v1alpha.Labels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLabelsTestCases

func GetLabelsTestCases[T manifest.Object](t *testing.T, propertyPath string) map[string]LabelsTestCase[T]

func GetMetadataAnnotationsTestCases

func GetMetadataAnnotationsTestCases[T manifest.Object](
	t *testing.T,
	propertyPath string,
) map[string]MetadataAnnotationsTestCase[T]

Types

type LabelsTestCase

type LabelsTestCase[T manifest.Object] struct {
	Labels v1alpha.Labels
	// contains filtered or unexported fields
}

func (LabelsTestCase[T]) Test

func (tc LabelsTestCase[T]) Test(t *testing.T, object T, validate func(T) *v1alpha.ObjectError)

type MetadataAnnotationsTestCase

type MetadataAnnotationsTestCase[T manifest.Object] struct {
	Annotations v1alpha.MetadataAnnotations
	// contains filtered or unexported fields
}

func (MetadataAnnotationsTestCase[T]) Test

func (tc MetadataAnnotationsTestCase[T]) Test(t *testing.T, object T, validate func(T) *v1alpha.ObjectError)

Jump to

Keyboard shortcuts

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