ardrone: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
7f61b2d7dd
commit
15049727d8
|
@ -2,6 +2,7 @@ package ardrone
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gobot.io/x/gobot"
|
||||
|
@ -36,6 +37,13 @@ func TestArdroneAdaptorConnect(t *testing.T) {
|
|||
gobottest.Assert(t, a.Connect(), errors.New("connection error"))
|
||||
}
|
||||
|
||||
func TestArdroneAdaptorName(t *testing.T) {
|
||||
a := initTestArdroneAdaptor()
|
||||
gobottest.Assert(t, strings.HasPrefix(a.Name(), "ARDrone"), true)
|
||||
a.SetName("NewName")
|
||||
gobottest.Assert(t, a.Name(), "NewName")
|
||||
}
|
||||
|
||||
func TestArdroneAdaptorFinalize(t *testing.T) {
|
||||
a := initTestArdroneAdaptor()
|
||||
gobottest.Assert(t, a.Finalize(), nil)
|
||||
|
|
|
@ -25,6 +25,13 @@ func TestArdroneDriver(t *testing.T) {
|
|||
gobottest.Assert(t, d.Name(), "mydrone")
|
||||
}
|
||||
|
||||
func TestArdroneDriverName(t *testing.T) {
|
||||
d := initTestArdroneDriver()
|
||||
gobottest.Assert(t, d.Name(), "mydrone")
|
||||
d.SetName("NewName")
|
||||
gobottest.Assert(t, d.Name(), "NewName")
|
||||
}
|
||||
|
||||
func TestArdroneDriverStart(t *testing.T) {
|
||||
d := initTestArdroneDriver()
|
||||
gobottest.Assert(t, d.Start(), nil)
|
||||
|
|
Loading…
Reference in New Issue