Fix broken tests
This commit is contained in:
parent
09bc76d501
commit
07b853ef2f
|
@ -1,8 +1,9 @@
|
|||
package gpio
|
||||
|
||||
import (
|
||||
"github.com/hybridgroup/gobot"
|
||||
"testing"
|
||||
|
||||
"github.com/hybridgroup/gobot"
|
||||
)
|
||||
|
||||
func initTestAnalogSensorDriver() *AnalogSensorDriver {
|
||||
|
@ -19,11 +20,6 @@ func TestAnalogSensorDriverHalt(t *testing.T) {
|
|||
gobot.Assert(t, d.Halt(), true)
|
||||
}
|
||||
|
||||
func TestAnalogSensorDriverInit(t *testing.T) {
|
||||
d := initTestAnalogSensorDriver()
|
||||
gobot.Assert(t, d.Init(), true)
|
||||
}
|
||||
|
||||
func TestAnalogSensorDriverRead(t *testing.T) {
|
||||
d := initTestAnalogSensorDriver()
|
||||
gobot.Assert(t, d.Read(), 99)
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package gpio
|
||||
|
||||
import (
|
||||
"github.com/hybridgroup/gobot"
|
||||
"testing"
|
||||
|
||||
"github.com/hybridgroup/gobot"
|
||||
)
|
||||
|
||||
func initTestButtonDriver() *ButtonDriver {
|
||||
|
@ -19,11 +20,6 @@ func TestButtonDriverHalt(t *testing.T) {
|
|||
gobot.Assert(t, d.Halt(), true)
|
||||
}
|
||||
|
||||
func TestButtonDriverInit(t *testing.T) {
|
||||
d := initTestButtonDriver()
|
||||
gobot.Assert(t, d.Init(), true)
|
||||
}
|
||||
|
||||
func TestButtonDriverReadState(t *testing.T) {
|
||||
d := initTestButtonDriver()
|
||||
gobot.Assert(t, d.readState(), 1)
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package gpio
|
||||
|
||||
import (
|
||||
"github.com/hybridgroup/gobot"
|
||||
"testing"
|
||||
|
||||
"github.com/hybridgroup/gobot"
|
||||
)
|
||||
|
||||
func initTestDirectPinDriver() *DirectPinDriver {
|
||||
|
@ -19,11 +20,6 @@ func TestDirectPinDriverHalt(t *testing.T) {
|
|||
gobot.Assert(t, d.Halt(), true)
|
||||
}
|
||||
|
||||
func TestDirectPinDriverInit(t *testing.T) {
|
||||
d := initTestDirectPinDriver()
|
||||
gobot.Assert(t, d.Init(), true)
|
||||
}
|
||||
|
||||
func TestDirectPinDriverDigitalRead(t *testing.T) {
|
||||
d := initTestDirectPinDriver()
|
||||
gobot.Assert(t, d.DigitalRead(), 1)
|
||||
|
|
|
@ -20,30 +20,25 @@ func TestLedDriverHalt(t *testing.T) {
|
|||
gobot.Assert(t, d.Halt(), true)
|
||||
}
|
||||
|
||||
func TestLedDriverInit(t *testing.T) {
|
||||
d := initTestLedDriver()
|
||||
gobot.Assert(t, d.Init(), true)
|
||||
}
|
||||
|
||||
func TestLedDriverOn(t *testing.T) {
|
||||
d := initTestLedDriver()
|
||||
gobot.Assert(t, d.On(), true)
|
||||
gobot.Assert(t, d.IsOn(), true)
|
||||
gobot.Assert(t, d.State(), true)
|
||||
}
|
||||
|
||||
func TestLedDriverOff(t *testing.T) {
|
||||
d := initTestLedDriver()
|
||||
gobot.Assert(t, d.Off(), true)
|
||||
gobot.Assert(t, d.IsOff(), true)
|
||||
gobot.Assert(t, d.State(), false)
|
||||
}
|
||||
|
||||
func TestLedDriverToggle(t *testing.T) {
|
||||
d := initTestLedDriver()
|
||||
d.Off()
|
||||
d.Toggle()
|
||||
gobot.Assert(t, d.IsOn(), true)
|
||||
gobot.Assert(t, d.State(), true)
|
||||
d.Toggle()
|
||||
gobot.Assert(t, d.IsOff(), true)
|
||||
gobot.Assert(t, d.State(), false)
|
||||
}
|
||||
|
||||
func TestLedDriverBrightness(t *testing.T) {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package gpio
|
||||
|
||||
import (
|
||||
"github.com/hybridgroup/gobot"
|
||||
"testing"
|
||||
|
||||
"github.com/hybridgroup/gobot"
|
||||
)
|
||||
|
||||
func initTestMotorDriver() *MotorDriver {
|
||||
|
@ -19,11 +20,6 @@ func TestMotorDriverHalt(t *testing.T) {
|
|||
gobot.Assert(t, d.Halt(), true)
|
||||
}
|
||||
|
||||
func TestMotorDriverInit(t *testing.T) {
|
||||
d := initTestMotorDriver()
|
||||
gobot.Assert(t, d.Init(), true)
|
||||
}
|
||||
|
||||
func TestMotorDriverIsOn(t *testing.T) {
|
||||
d := initTestMotorDriver()
|
||||
d.CurrentMode = "digital"
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package gpio
|
||||
|
||||
import (
|
||||
"github.com/hybridgroup/gobot"
|
||||
"testing"
|
||||
|
||||
"github.com/hybridgroup/gobot"
|
||||
)
|
||||
|
||||
func initTestServoDriver() *ServoDriver {
|
||||
|
@ -19,11 +20,6 @@ func TestServoDriverHalt(t *testing.T) {
|
|||
gobot.Assert(t, d.Halt(), true)
|
||||
}
|
||||
|
||||
func TestServoDriverInit(t *testing.T) {
|
||||
d := initTestServoDriver()
|
||||
gobot.Assert(t, d.Init(), true)
|
||||
}
|
||||
|
||||
func TestServoDriverMove(t *testing.T) {
|
||||
d := initTestServoDriver()
|
||||
d.Move(100)
|
||||
|
|
Loading…
Reference in New Issue