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