pkgtest

package
v0.74.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertPackagesEqual added in v0.61.0

func AssertPackagesEqual(t *testing.T, a, b pkg.Package)

func DefaultLocationComparer added in v0.61.0

func DefaultLocationComparer(x, y source.Location) bool

func TestFileParser

func TestFileParser(t *testing.T, fixturePath string, parser generic.Parser, expectedPkgs []pkg.Package, expectedRelationships []artifact.Relationship)

func TestFileParserWithEnv

func TestFileParserWithEnv(t *testing.T, fixturePath string, parser generic.Parser, env *generic.Environment, expectedPkgs []pkg.Package, expectedRelationships []artifact.Relationship)

Types

type CatalogTester

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

func NewCatalogTester

func NewCatalogTester() *CatalogTester

func (*CatalogTester) Expects

func (p *CatalogTester) Expects(pkgs []pkg.Package, relationships []artifact.Relationship) *CatalogTester

func (*CatalogTester) ExpectsResolverContentQueries added in v0.71.0

func (p *CatalogTester) ExpectsResolverContentQueries(locations []string) *CatalogTester

func (*CatalogTester) ExpectsResolverPathResponses added in v0.71.0

func (p *CatalogTester) ExpectsResolverPathResponses(locations []string) *CatalogTester

func (*CatalogTester) FromDirectory added in v0.60.3

func (p *CatalogTester) FromDirectory(t *testing.T, path string) *CatalogTester

func (*CatalogTester) FromFile

func (p *CatalogTester) FromFile(t *testing.T, path string) *CatalogTester

func (*CatalogTester) FromString

func (p *CatalogTester) FromString(location, data string) *CatalogTester

func (*CatalogTester) IgnoreLocationLayer

func (p *CatalogTester) IgnoreLocationLayer() *CatalogTester

func (*CatalogTester) IgnorePackageFields added in v0.61.0

func (p *CatalogTester) IgnorePackageFields(fields ...string) *CatalogTester

func (*CatalogTester) IgnoreUnfulfilledPathResponses added in v0.71.0

func (p *CatalogTester) IgnoreUnfulfilledPathResponses(paths ...string) *CatalogTester

func (*CatalogTester) TestCataloger

func (p *CatalogTester) TestCataloger(t *testing.T, cataloger pkg.Cataloger)

func (*CatalogTester) TestParser

func (p *CatalogTester) TestParser(t *testing.T, parser generic.Parser)

func (*CatalogTester) WithCompareOptions added in v0.71.0

func (p *CatalogTester) WithCompareOptions(opts ...cmp.Option) *CatalogTester

func (*CatalogTester) WithEnv

func (p *CatalogTester) WithEnv(env *generic.Environment) *CatalogTester

func (*CatalogTester) WithError

func (p *CatalogTester) WithError() *CatalogTester

func (*CatalogTester) WithErrorAssertion

func (p *CatalogTester) WithErrorAssertion(a require.ErrorAssertionFunc) *CatalogTester

func (*CatalogTester) WithImageResolver

func (p *CatalogTester) WithImageResolver(t *testing.T, fixtureName string) *CatalogTester

func (*CatalogTester) WithLinuxRelease

func (p *CatalogTester) WithLinuxRelease(r linux.Release) *CatalogTester

func (*CatalogTester) WithResolver

func (p *CatalogTester) WithResolver(r source.FileResolver) *CatalogTester

type ObservingResolver added in v0.71.0

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

func NewObservingResolver added in v0.71.0

func NewObservingResolver(resolver source.FileResolver) *ObservingResolver

func (*ObservingResolver) AllContentQueries added in v0.71.0

func (r *ObservingResolver) AllContentQueries() []string

func (*ObservingResolver) AllLocations added in v0.71.0

func (r *ObservingResolver) AllLocations() <-chan source.Location

func (*ObservingResolver) AllPathQueries added in v0.71.0

func (r *ObservingResolver) AllPathQueries() map[string][]string

func (*ObservingResolver) FileContentsByLocation added in v0.71.0

func (r *ObservingResolver) FileContentsByLocation(location source.Location) (io.ReadCloser, error)

func (*ObservingResolver) FileMetadataByLocation added in v0.71.0

func (r *ObservingResolver) FileMetadataByLocation(location source.Location) (source.FileMetadata, error)

func (*ObservingResolver) FilesByGlob added in v0.71.0

func (r *ObservingResolver) FilesByGlob(patterns ...string) ([]source.Location, error)

func (*ObservingResolver) FilesByMIMEType added in v0.71.0

func (r *ObservingResolver) FilesByMIMEType(types ...string) ([]source.Location, error)

func (*ObservingResolver) FilesByPath added in v0.71.0

func (r *ObservingResolver) FilesByPath(paths ...string) ([]source.Location, error)

func (*ObservingResolver) HasPath added in v0.71.0

func (r *ObservingResolver) HasPath(s string) bool

func (*ObservingResolver) HasUnfulfilledPathRequests added in v0.71.0

func (r *ObservingResolver) HasUnfulfilledPathRequests() bool

func (*ObservingResolver) ObservedContentQueries added in v0.71.0

func (r *ObservingResolver) ObservedContentQueries(path string) bool

func (*ObservingResolver) ObservedPathQuery added in v0.71.0

func (r *ObservingResolver) ObservedPathQuery(input string) bool

func (*ObservingResolver) ObservedPathResponses added in v0.71.0

func (r *ObservingResolver) ObservedPathResponses(path string) bool

func (*ObservingResolver) PrettyUnfulfilledPathRequests added in v0.71.0

func (r *ObservingResolver) PrettyUnfulfilledPathRequests() string

func (*ObservingResolver) PruneUnfulfilledPathResponses added in v0.71.0

func (r *ObservingResolver) PruneUnfulfilledPathResponses(ignore map[string][]string, ignorePaths ...string)

func (*ObservingResolver) RelativeFileByPath added in v0.71.0

func (r *ObservingResolver) RelativeFileByPath(l source.Location, path string) *source.Location

Jump to

Keyboard shortcuts

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