hybridgroup.gobot/platforms/mavlink/mavlink_driver_test.go

25 lines
529 B
Go
Raw Normal View History

2014-08-01 14:39:52 +08:00
package mavlink
import (
"testing"
"github.com/hybridgroup/gobot"
)
func initTestMavlinkDriver() *MavlinkDriver {
2014-08-05 03:06:54 +08:00
m := NewMavlinkAdaptor("myAdaptor", "/dev/null")
m.sp = gobot.NullReadWriteCloser{}
2014-11-20 08:03:50 +08:00
m.connect = func(a *MavlinkAdaptor) (err error) { return nil }
2014-08-05 03:06:54 +08:00
return NewMavlinkDriver(m, "myDriver")
2014-08-01 14:39:52 +08:00
}
func TestMavlinkDriverStart(t *testing.T) {
d := initTestMavlinkDriver()
gobot.Assert(t, d.Start(), nil)
2014-08-01 14:39:52 +08:00
}
func TestMavlinkDriverHalt(t *testing.T) {
d := initTestMavlinkDriver()
gobot.Assert(t, d.Halt(), nil)
2014-08-01 14:39:52 +08:00
}