raspi: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
135a0f9b4d
commit
ac74498342
|
@ -1,6 +1,7 @@
|
|||
package raspi
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"gobot.io/x/gobot/gobottest"
|
||||
|
@ -33,6 +34,10 @@ func TestPwmPin(t *testing.T) {
|
|||
dc, _ = pin.DutyCycle()
|
||||
gobottest.Assert(t, dc, uint32(10000))
|
||||
|
||||
gobottest.Assert(t, pin.SetDutyCycle(999999999), errors.New("Duty cycle exceeds period."))
|
||||
dc, _ = pin.DutyCycle()
|
||||
gobottest.Assert(t, dc, uint32(10000))
|
||||
|
||||
// call currently fails in test
|
||||
gobottest.Refute(t, pin.Unexport(), nil)
|
||||
}
|
||||
|
|
|
@ -147,6 +147,10 @@ func TestAdaptorDigitalIO(t *testing.T) {
|
|||
fs.WithReadError = true
|
||||
_, err := a.DigitalRead("13")
|
||||
gobottest.Assert(t, err, errors.New("read error"))
|
||||
|
||||
fs.WithWriteError = true
|
||||
_, err = a.DigitalRead("7")
|
||||
gobottest.Assert(t, err, errors.New("write error"))
|
||||
}
|
||||
|
||||
func TestAdaptorI2c(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue