Skip to content

Commit

Permalink
gpio: increase test coverage for relay driver
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Mar 21, 2017
1 parent 4ff1b0c commit ccd03a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/gpio/relay_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,15 @@ func TestRelayDriverToggle(t *testing.T) {
d.Toggle()
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)
}

0 comments on commit ccd03a1

Please sign in to comment.