2014-04-28 19:39:51 +08:00
|
|
|
package beaglebone
|
2014-04-26 18:11:51 +08:00
|
|
|
|
|
|
|
import (
|
2014-06-13 07:12:38 +08:00
|
|
|
"github.com/hybridgroup/gobot"
|
|
|
|
"testing"
|
2014-04-26 18:11:51 +08:00
|
|
|
)
|
|
|
|
|
2014-06-14 07:01:39 +08:00
|
|
|
func initTestBeagleboneAdaptor() *BeagleboneAdaptor {
|
2014-07-01 10:50:28 +08:00
|
|
|
b := NewBeagleboneAdaptor("bot")
|
|
|
|
b.connect = func() {}
|
|
|
|
return b
|
2014-06-13 07:12:38 +08:00
|
|
|
}
|
2014-04-26 18:11:51 +08:00
|
|
|
|
2014-06-14 07:01:39 +08:00
|
|
|
func TestBeagleboneAdaptorFinalize(t *testing.T) {
|
|
|
|
a := initTestBeagleboneAdaptor()
|
2014-07-18 02:41:47 +08:00
|
|
|
gobot.Assert(t, a.Finalize(), true)
|
2014-06-13 07:12:38 +08:00
|
|
|
}
|
2014-06-14 07:01:39 +08:00
|
|
|
func TestBeagleboneAdaptorConnect(t *testing.T) {
|
|
|
|
a := initTestBeagleboneAdaptor()
|
2014-07-18 02:41:47 +08:00
|
|
|
gobot.Assert(t, a.Connect(), true)
|
2014-06-13 07:12:38 +08:00
|
|
|
}
|
2014-06-14 07:01:39 +08:00
|
|
|
func TestBeagleboneAdaptorDisconnect(t *testing.T) {
|
|
|
|
a := initTestBeagleboneAdaptor()
|
2014-07-18 02:41:47 +08:00
|
|
|
gobot.Assert(t, a.Disconnect(), true)
|
2014-06-13 07:12:38 +08:00
|
|
|
}
|
2014-06-14 07:01:39 +08:00
|
|
|
func TestBeagleboneAdaptorReconnect(t *testing.T) {
|
|
|
|
a := initTestBeagleboneAdaptor()
|
2014-07-18 02:41:47 +08:00
|
|
|
gobot.Assert(t, a.Reconnect(), true)
|
2014-06-13 07:12:38 +08:00
|
|
|
}
|