testutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareCommand

func PrepareCommand(cmd *cobra.Command, env *azldev.Env) *cobra.Command

Types

type TestEnv

type TestEnv struct {
	Env    *azldev.Env
	Config *projectconfig.ProjectConfig

	TestInterfaces azldev.SystemInterfaces

	// Test implementations
	CmdFactory       *testctx.TestCmdFactory
	DryRunnable      opctx.DryRunnable
	EventListener    opctx.EventListener
	TestFS           opctx.FS
	TestOSEnv        opctx.OSEnv
	CommandsExecuted [][]string
}

Test environment, useful for unit-testing azldev CLI commands. Contains an azldev.Env constructed with injected dependencies that redirect filesystem and OS environmental access to included test objects.

func NewTestEnv

func NewTestEnv(t *testing.T) *TestEnv

Constructs a new TestEnv.

func (*TestEnv) FS

func (e *TestEnv) FS() opctx.FS

FS implements the opctx.FileSystemFactory interface.

func (*TestEnv) OSEnv

func (e *TestEnv) OSEnv() opctx.OSEnv

FS implements the opctx.OSEnvFactory interface.

Jump to

Keyboard shortcuts

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