hermittest

package
v0.39.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvTestFixture

type EnvTestFixture struct {
	State   *state.State
	EnvDirs []string
	Env     *hermit.Env
	Logs    *bytes.Buffer
	Server  *httptest.Server
	P       *ui.UI

	Cache *cache.Cache
	// contains filtered or unexported fields
}

EnvTestFixture encapsulates the directories used by Env and the Env itself

func NewEnvTestFixture

func NewEnvTestFixture(t *testing.T, handler http.Handler) *EnvTestFixture

NewEnvTestFixture returns a new empty fixture with Env initialised to default values. A test handler can be given to be used as an test http server for testing http interactions

func (*EnvTestFixture) Clean

func (f *EnvTestFixture) Clean()

Clean removes all files and directories from this environment

func (*EnvTestFixture) DAO

func (f *EnvTestFixture) DAO() *dao.DAO

DAO returns the DAO using the underlying hermit database

func (*EnvTestFixture) GetDBPackage

func (f *EnvTestFixture) GetDBPackage(ref string) *dao.Package

GetDBPackage return the data from the DB for a package

func (*EnvTestFixture) NewEnv

func (f *EnvTestFixture) NewEnv() *hermit.Env

NewEnv returns a new environment using the state directory from this fixture

func (*EnvTestFixture) RootDir

func (f *EnvTestFixture) RootDir() string

RootDir returns the directory to the environment package root

func (*EnvTestFixture) WithManifests

func (f *EnvTestFixture) WithManifests(files map[string]string) *EnvTestFixture

WithManifests sets the resolver manifests for the current environment. Warning: any additional environments created from this fixture previously will not be updated.

Jump to

Keyboard shortcuts

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