testutils

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultValidBundleMap

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

Types

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

Jump to

Keyboard shortcuts

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