test_utils

package
v0.0.0-...-ef671bc Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetadataSample = metadata.Metadata{
	Dependencies: []metadata.Dependency{
		{
			Type: "debian_package_list",
			Source: metadata.Source{
				Version: map[string]interface{}{
					"sha256": "some-sha",
				},
				Metadata: metadata.DebianPackageListSourceMetadata{
					Packages: []metadata.DpkgPackage{
						{
							Package:      "foobar",
							Version:      "0.42.0-version",
							Architecture: "amd46",
							Source: metadata.PackageSource{
								Package:         "foobar",
								Version:         "0.42.0-source",
								UpstreamVersion: "0.42.0-upstream",
							},
						},
					},
					AptSources: nil,
				},
			},
		},
	},
}

Functions

func AppendContent

func AppendContent(filePath string) string

func CleanupFile

func CleanupFile(filePath string)

func ExistingFileName

func ExistingFileName() string

func NonExistingFileName

func NonExistingFileName() string

func SelectBuildpackDependency

func SelectBuildpackDependency(dependencies []metadata.Dependency) (metadata.Dependency, bool)

func SelectDpkgDependency

func SelectDpkgDependency(dependencies []metadata.Dependency) (metadata.Dependency, bool)

func SelectKpackDependency

func SelectKpackDependency(dependencies []metadata.Dependency) (metadata.Dependency, bool)

func SelectRpmDependency

func SelectRpmDependency(dependencies []metadata.Dependency) (metadata.Dependency, bool)

Types

type MockImage

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

func NewMockImageWithEmptyConfig

func NewMockImageWithEmptyConfig() MockImage

func NewMockImageWithPath

func NewMockImageWithPath(path string) MockImage

func (MockImage) AbsolutePath

func (m MockImage) AbsolutePath(string) (string, error)

func (MockImage) Cleanup

func (m MockImage) Cleanup()

func (MockImage) ExportWithMetadata

func (m MockImage) ExportWithMetadata(metadata.Metadata, string, string) error

func (MockImage) GetConfig

func (m MockImage) GetConfig() (*v1.ConfigFile, error)

func (MockImage) GetDirContents

func (m MockImage) GetDirContents(string) ([]string, error)

func (MockImage) GetDirFileNames

func (m MockImage) GetDirFileNames(string, bool) ([]string, error)

func (MockImage) GetFileContent

func (m MockImage) GetFileContent(string) (string, error)

Jump to

Keyboard shortcuts

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