Documentation ¶
Index ¶
- type EnvTestFixture
- func (f *EnvTestFixture) Clean()
- func (f *EnvTestFixture) DAO() *dao.DAO
- func (f *EnvTestFixture) GetDBPackage(ref string) *dao.Package
- func (f *EnvTestFixture) NewEnv() *hermit.Env
- func (f *EnvTestFixture) RootDir() string
- func (f *EnvTestFixture) WithManifests(files map[string]string) *EnvTestFixture
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.