hybridgroup.gobot/platforms/mavlink/mavlink_adaptor_test.go

25 lines
517 B
Go
Raw Normal View History

2014-08-01 14:39:52 +08:00
package mavlink
import (
"testing"
"github.com/hybridgroup/gobot"
)
func initTestMavlinkAdaptor() *MavlinkAdaptor {
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 m
2014-08-01 14:39:52 +08:00
}
func TestMavlinkAdaptorConnect(t *testing.T) {
a := initTestMavlinkAdaptor()
gobot.Assert(t, a.Connect(), nil)
2014-08-01 14:39:52 +08:00
}
func TestMavlinkAdaptorFinalize(t *testing.T) {
a := initTestMavlinkAdaptor()
gobot.Assert(t, a.Finalize(), nil)
2014-08-01 14:39:52 +08:00
}