Documentation
¶
Overview ¶
Package upowertest serves a scriptable UPower on a test bus: the DisplayDevice and enumerated devices, each change announced with the signal the real daemon sends, and every GetAll counted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Battery ¶
func Battery(percentage float64, state upower.DeviceState, warning upower.WarningLevel) map[string]dbus.Variant
Battery is a DisplayDevice's properties.
func Peripheral ¶
func Peripheral(kind upower.DeviceKind, model string, percentage float64, warning upower.WarningLevel) map[string]dbus.Variant
Peripheral is an enumerated device's properties.
Types ¶
type Fake ¶
type Fake struct {
// contains filtered or unexported fields
}
Fake is UPower as the test scripts it.
func Serve ¶
Serve claims UPower's name on conn with a DisplayDevice holding display and no other device.
func (*Fake) Change ¶
Change replaces an existing device's properties and emits its PropertiesChanged.
func (*Fake) Reads ¶
func (f *Fake) Reads(path dbus.ObjectPath) int
Reads is how many GetAll calls path has answered.
func (*Fake) Remove ¶
func (f *Fake) Remove(path dbus.ObjectPath)
Remove withdraws a device and emits DeviceRemoved.