package
0.0.0-20250128235618-90ded3253a49
Repository: https://github.com/cosnicolaou/automation.git
Documentation: pkg.go.dev
# README
Package github.com/cosnicolaou/automation/internal/testutil
import github.com/cosnicolaou/automation/internal/testutil
Types
Type ControllerDetail
type ControllerDetail struct {
Detail string `yaml:"detail"`
KeyID string `yaml:"key_id"`
}
Type DeviceDetail
type DeviceDetail struct {
Detail string `yaml:"detail"`
}
Type MockController
type MockController struct {
devices.ControllerBase[ControllerDetail]
}
Methods
func (c *MockController) Disable(_ context.Context, opts devices.OperationArgs) error
func (c *MockController) Enable(_ context.Context, opts devices.OperationArgs) error
func (c *MockController) Implementation() any
func (c *MockController) Operations() map[string]devices.Operation
func (c *MockController) OperationsHelp() map[string]string
Type MockDevice
type MockDevice struct {
devices.DeviceBase[DeviceDetail]
// contains filtered or unexported fields
}
Functions
func NewMockDevice(operations ...string) *MockDevice
Methods
func (d *MockDevice) AddCondition(name string, outcome bool)
func (d *MockDevice) Conditions() map[string]devices.Condition
func (d *MockDevice) ConditionsHelp() map[string]string
func (d *MockDevice) ControlledBy() devices.Controller
func (d *MockDevice) Implementation() any
func (d *MockDevice) Operations() map[string]devices.Operation
func (d *MockDevice) OperationsHelp() map[string]string
func (d *MockDevice) SetController(c devices.Controller)
func (d *MockDevice) SetOutput(logger bool, writer bool)