testing

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: ISC Imports: 36 Imported by: 0 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 GenerateContext

func GenerateContext(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer) *kcontext.KContext

func GenerateFiles

func GenerateFiles(t *testing.T, files []MockFile) string

func GenerateRepository

func GenerateRepository(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer, passphrase *[]byte) *repository.Repository

func GenerateRepositoryWithConfig added in v1.1.9

func GenerateRepositoryWithConfig(t *testing.T, bufout *bytes.Buffer, buferr *bytes.Buffer, passphrase *[]byte, tweak func(*storage.Configuration)) *repository.Repository

GenerateRepositoryWithConfig is GenerateRepository with tweak applied to the configuration before the repository is created.

func GenerateSnapshot

func GenerateSnapshot(t *testing.T, repo *repository.Repository, files []MockFile, opts ...TestingOptions) *snapshot.Snapshot

func NewConfiguration

func NewConfiguration(opts ...ConfigurationOptions) *storage.Configuration

func NewMockExporter

func NewMockExporter(appCtx context.Context, opt *connectors.Options, name string, config map[string]string) (exporter.Exporter, error)

func NewMockImporter

func NewMockImporter(appCtx context.Context, opts *connectors.Options, name string, config map[string]string) (importer.Importer, error)

Types

type ConfigurationOptions

type ConfigurationOptions func(o *storage.Configuration)

func WithConfigurationCompression

func WithConfigurationCompression(compression *compression.Configuration) ConfigurationOptions

type MockBackend

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

MockBackend implements the Backend interface for testing purposes

func NewMockBackend

func NewMockBackend(storeConfig map[string]string) *MockBackend

func (*MockBackend) Close

func (mb *MockBackend) Close(ctx context.Context) error

func (*MockBackend) Create

func (mb *MockBackend) Create(ctx context.Context, configuration []byte) error

func (*MockBackend) Delete added in v1.1.0

func (mb *MockBackend) Delete(ctx context.Context, res storage.StorageResource, mac objects.MAC) error

func (*MockBackend) Flags added in v1.1.0

func (mb *MockBackend) Flags() location.Flags

func (*MockBackend) Get added in v1.1.0

func (*MockBackend) List added in v1.1.0

func (*MockBackend) Mode

func (*MockBackend) Open

func (mb *MockBackend) Open(ctx context.Context) ([]byte, error)

func (*MockBackend) Origin added in v1.1.0

func (mb *MockBackend) Origin() string

func (*MockBackend) Ping added in v1.1.0

func (mb *MockBackend) Ping(ctx context.Context) error

func (*MockBackend) Put added in v1.1.0

func (*MockBackend) Root added in v1.1.0

func (mb *MockBackend) Root() string

func (*MockBackend) Size

func (mb *MockBackend) Size(ctx context.Context) (int64, error)

func (*MockBackend) Type added in v1.1.0

func (mb *MockBackend) Type() string

type MockClassifierBackend

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

func (*MockClassifierBackend) Close

func (m *MockClassifierBackend) Close() error

func (*MockClassifierBackend) Processor

type MockExporter

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

func (*MockExporter) Close

func (e *MockExporter) Close(ctx context.Context) error

func (*MockExporter) Export added in v1.1.0

func (e *MockExporter) Export(ctx context.Context, records <-chan *connectors.Record, results chan<- *connectors.Result) error

func (*MockExporter) Files

func (e *MockExporter) Files() map[string][]byte

func (*MockExporter) Flags added in v1.1.0

func (p *MockExporter) Flags() location.Flags

func (*MockExporter) Origin added in v1.1.0

func (e *MockExporter) Origin() string

func (*MockExporter) Ping added in v1.1.0

func (e *MockExporter) Ping(ctx context.Context) error

func (*MockExporter) Root

func (e *MockExporter) Root() string

func (*MockExporter) Type added in v1.1.0

func (e *MockExporter) Type() string

type MockFile

type MockFile struct {
	Path    string
	IsDir   bool
	Mode    os.FileMode
	Content []byte
}

func NewMockDir

func NewMockDir(path string) MockFile

func NewMockFile

func NewMockFile(path string, mode os.FileMode, content string) MockFile

func (*MockFile) ScanResult

func (m *MockFile) ScanResult() *connectors.Record

type MockImporter

type MockImporter struct {
	FakeRoot string
	// contains filtered or unexported fields
}

func (*MockImporter) Close

func (p *MockImporter) Close(ctx context.Context) error

func (*MockImporter) Flags added in v1.1.0

func (p *MockImporter) Flags() location.Flags

func (*MockImporter) Import added in v1.1.0

func (p *MockImporter) Import(ctx context.Context, records chan<- *connectors.Record, results <-chan *connectors.Result) error

func (*MockImporter) Origin

func (p *MockImporter) Origin() string

func (*MockImporter) Ping added in v1.1.0

func (p *MockImporter) Ping(ctx context.Context) error

func (*MockImporter) Root

func (p *MockImporter) Root() string

func (*MockImporter) SetFiles

func (p *MockImporter) SetFiles(files []MockFile)

func (*MockImporter) SetGenerator

func (p *MockImporter) SetGenerator(gen func(chan<- *connectors.Record))

func (*MockImporter) Type

func (p *MockImporter) Type() string

type MockProcessorBackend

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

func (*MockProcessorBackend) Directory

func (m *MockProcessorBackend) Directory(dirEntry *vfs.Entry) []string

func (*MockProcessorBackend) File

func (m *MockProcessorBackend) File(fileEntry *vfs.Entry) []string

func (*MockProcessorBackend) Finalize

func (m *MockProcessorBackend) Finalize() []string

func (*MockProcessorBackend) Name

func (m *MockProcessorBackend) Name() string

func (*MockProcessorBackend) Write

func (m *MockProcessorBackend) Write(buf []byte) bool

type TestingOptions

type TestingOptions func(o *testingOptions)

func WithExcludes

func WithExcludes(excludes []string) TestingOptions

func WithGenerator

func WithGenerator(gen func(chan<- *connectors.Record)) TestingOptions

func WithName

func WithName(name string) TestingOptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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