1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-27 13:48:56 +08:00
hybridgroup.gobot/platforms/mavlink/mavlink_adaptor_test.go

25 lines
523 B
Go
Raw Normal View History

2014-07-31 23:39:52 -07:00
package mavlink
import (
"testing"
"github.com/hybridgroup/gobot"
)
func initTestMavlinkAdaptor() *MavlinkAdaptor {
2014-08-04 12:06:54 -07:00
m := NewMavlinkAdaptor("myAdaptor", "/dev/null")
m.sp = gobot.NullReadWriteCloser{}
2014-11-19 16:03:50 -08:00
m.connect = func(a *MavlinkAdaptor) (err error) { return nil }
2014-08-04 12:06:54 -07:00
return m
2014-07-31 23:39:52 -07:00
}
func TestMavlinkAdaptorConnect(t *testing.T) {
a := initTestMavlinkAdaptor()
gobot.Assert(t, len(a.Connect()), 0)
2014-07-31 23:39:52 -07:00
}
func TestMavlinkAdaptorFinalize(t *testing.T) {
a := initTestMavlinkAdaptor()
gobot.Assert(t, len(a.Finalize()), 0)
2014-07-31 23:39:52 -07:00
}