testutils

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultValidBundleMap

func DefaultValidBundleMap() (map[string]types.MetaBundle, error)

Types

type BundleLoader added in v0.14.0

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

func NewBundlerLoader added in v0.14.0

func NewBundlerLoader(t *testing.T) *BundleLoader

func (*BundleLoader) LoadFromCSV added in v0.14.0

func (l *BundleLoader) LoadFromCSV(path string, opts ...LoadOption) operator.Bundle

type LoadOption added in v0.14.0

type LoadOption interface {
	ConfigureBundleLoad(*loadConfig)
}

type MockOCMClient added in v0.12.0

type MockOCMClient struct {
	mock.Mock
}

MockOCMClient satisfies the types.OCMClient interface and is used to test validators interacting with OCM.

func NewMockOCMClient added in v0.12.0

func NewMockOCMClient() *MockOCMClient

func (*MockOCMClient) CloseConnection added in v0.12.0

func (m *MockOCMClient) CloseConnection() error

func (*MockOCMClient) QuotaRuleExists added in v0.12.0

func (m *MockOCMClient) QuotaRuleExists(ctx context.Context, ocmQuotaName string) (bool, error)

type MockQuayClient added in v0.12.0

type MockQuayClient struct {
	mock.Mock
}

func NewMockQuayClient added in v0.12.0

func NewMockQuayClient() *MockQuayClient

func (*MockQuayClient) HasReference added in v0.12.0

func (c *MockQuayClient) HasReference(ctx context.Context, ref validator.ImageReference) (bool, error)

type ValidatorTester

type ValidatorTester struct {
	*testing.T
	Val validator.Validator
	// contains filtered or unexported fields
}

func NewValidatorTester

func NewValidatorTester(t *testing.T, init validator.Initializer, opts ...ValidatorTesterOption) ValidatorTester

func (*ValidatorTester) Option

func (v *ValidatorTester) Option(opt ValidatorTesterOption)

func (*ValidatorTester) TestInvalidBundles

func (v *ValidatorTester) TestInvalidBundles(bundles map[string]types.MetaBundle)

func (*ValidatorTester) TestSingleBundle

func (v *ValidatorTester) TestSingleBundle(mb types.MetaBundle) validator.Result

func (*ValidatorTester) TestValidBundles

func (v *ValidatorTester) TestValidBundles(bundles map[string]types.MetaBundle)

type ValidatorTesterOption

type ValidatorTesterOption func(*ValidatorTester)

func ValidatorTesterLogger

func ValidatorTesterLogger(l logr.Logger) ValidatorTesterOption

func ValidatorTesterOCMClient

func ValidatorTesterOCMClient(ocm validator.OCMClient) ValidatorTesterOption

func ValidatorTesterQuayClient added in v0.12.0

func ValidatorTesterQuayClient(quay validator.QuayClient) ValidatorTesterOption

type WithBundleName added in v0.14.0

type WithBundleName string

func (WithBundleName) ConfigureBundleLoad added in v0.14.0

func (w WithBundleName) ConfigureBundleLoad(c *loadConfig)

type WithPackageName added in v0.14.0

type WithPackageName string

func (WithPackageName) ConfigureBundleLoad added in v0.14.0

func (w WithPackageName) ConfigureBundleLoad(c *loadConfig)

Jump to

Keyboard shortcuts

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