edison: increase test coverage

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-04-06 10:10:10 +02:00
parent 0ed755c6a4
commit 7639656968
1 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package edison
import (
"errors"
"strings"
"testing"
"gobot.io/x/gobot"
@ -97,6 +98,13 @@ func initTestAdaptor() (*Adaptor, *sysfs.MockFilesystem) {
return a, fs
}
func TestEdisonAdaptorName(t *testing.T) {
a, _ := initTestAdaptor()
gobottest.Assert(t, strings.HasPrefix(a.Name(), "Edison"), true)
a.SetName("NewName")
gobottest.Assert(t, a.Name(), "NewName")
}
func TestAdaptorConnect(t *testing.T) {
a, _ := initTestAdaptor()
gobottest.Assert(t, a.Connect(), nil)