2014-04-29 02:23:12 +08:00
|
|
|
package ardrone
|
2014-04-26 18:11:51 +08:00
|
|
|
|
|
|
|
import (
|
2014-06-13 07:07:40 +08:00
|
|
|
"testing"
|
2014-11-23 10:56:23 +08:00
|
|
|
|
|
|
|
"github.com/hybridgroup/gobot"
|
2014-04-26 18:11:51 +08:00
|
|
|
)
|
|
|
|
|
2014-06-15 04:55:12 +08:00
|
|
|
func initTestArdroneAdaptor() *ArdroneAdaptor {
|
2014-06-14 07:01:39 +08:00
|
|
|
a := NewArdroneAdaptor("drone")
|
2014-11-17 05:46:23 +08:00
|
|
|
a.connect = func(a *ArdroneAdaptor) error {
|
2014-06-15 04:55:12 +08:00
|
|
|
a.drone = &testDrone{}
|
2014-11-17 05:46:23 +08:00
|
|
|
return nil
|
2014-06-13 07:07:40 +08:00
|
|
|
}
|
2014-06-15 04:55:12 +08:00
|
|
|
return a
|
2014-06-13 07:07:40 +08:00
|
|
|
}
|
2014-04-26 18:11:51 +08:00
|
|
|
|
2014-06-13 07:07:40 +08:00
|
|
|
func TestConnect(t *testing.T) {
|
2014-06-15 04:55:12 +08:00
|
|
|
a := initTestArdroneAdaptor()
|
2014-11-20 15:21:19 +08:00
|
|
|
gobot.Assert(t, len(a.Connect()), 0)
|
2014-06-13 07:07:40 +08:00
|
|
|
}
|
|
|
|
|
2014-06-15 04:55:12 +08:00
|
|
|
func TestFinalize(t *testing.T) {
|
|
|
|
a := initTestArdroneAdaptor()
|
2014-11-20 15:21:19 +08:00
|
|
|
gobot.Assert(t, len(a.Finalize()), 0)
|
2014-06-13 07:07:40 +08:00
|
|
|
}
|