gpio: increase test coverage for relay driver
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
4ff1b0c83c
commit
ccd03a1b19
|
@ -44,3 +44,15 @@ func TestRelayDriverToggle(t *testing.T) {
|
||||||
d.Toggle()
|
d.Toggle()
|
||||||
gobottest.Assert(t, d.State(), false)
|
gobottest.Assert(t, d.State(), false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRelayDriverCommands(t *testing.T) {
|
||||||
|
d := initTestRelayDriver(newGpioTestAdaptor())
|
||||||
|
gobottest.Assert(t, d.Command("Off")(nil), nil)
|
||||||
|
gobottest.Assert(t, d.State(), false)
|
||||||
|
|
||||||
|
gobottest.Assert(t, d.Command("On")(nil), nil)
|
||||||
|
gobottest.Assert(t, d.State(), true)
|
||||||
|
|
||||||
|
gobottest.Assert(t, d.Command("Toggle")(nil), nil)
|
||||||
|
gobottest.Assert(t, d.State(), false)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue