Skip to content

Commit

Permalink
fix basic motor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martha-johnston committed Sep 3, 2024
1 parent bbe071f commit 1e1b14f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions components/motor/gpio/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ func TestMotorABPWM(t *testing.T) {

t.Run("motor (A/B/PWM) GoFor testing", func(t *testing.T) {
test.That(t, m.GoFor(ctx, 50, 0, nil), test.ShouldBeNil)
test.That(t, mustGetGPIOPinByName(b, "1").Get(context.Background()), test.ShouldEqual, true)
test.That(t, mustGetGPIOPinByName(b, "1").Get(context.Background()), test.ShouldEqual, false)
test.That(t, mustGetGPIOPinByName(b, "2").Get(context.Background()), test.ShouldEqual, false)
test.That(t, mustGetGPIOPinByName(b, "3").PWM(context.Background()), test.ShouldEqual, .5)
test.That(t, mustGetGPIOPinByName(b, "3").PWM(context.Background()), test.ShouldEqual, 0)

test.That(t, m.GoFor(ctx, -50, 0, nil), test.ShouldBeNil)
test.That(t, mustGetGPIOPinByName(b, "1").Get(context.Background()), test.ShouldEqual, false)
test.That(t, mustGetGPIOPinByName(b, "2").Get(context.Background()), test.ShouldEqual, true)
test.That(t, mustGetGPIOPinByName(b, "3").PWM(context.Background()), test.ShouldEqual, .5)
test.That(t, mustGetGPIOPinByName(b, "2").Get(context.Background()), test.ShouldEqual, false)
test.That(t, mustGetGPIOPinByName(b, "3").PWM(context.Background()), test.ShouldEqual, 0)

test.That(t, m.GoFor(ctx, 0, 1, nil), test.ShouldBeError, motor.NewZeroRPMError())
test.That(t, m.Stop(context.Background(), nil), test.ShouldBeNil)
Expand Down Expand Up @@ -204,12 +204,12 @@ func TestMotorDirPWM(t *testing.T) {

t.Run("motor (DIR/PWM) GoFor testing", func(t *testing.T) {
test.That(t, m.GoFor(ctx, 50, 0, nil), test.ShouldBeNil)
test.That(t, mustGetGPIOPinByName(b, "1").Get(context.Background()), test.ShouldEqual, true)
test.That(t, mustGetGPIOPinByName(b, "3").PWM(context.Background()), test.ShouldEqual, .5)
test.That(t, mustGetGPIOPinByName(b, "1").Get(context.Background()), test.ShouldEqual, false)
test.That(t, mustGetGPIOPinByName(b, "3").PWM(context.Background()), test.ShouldEqual, 0)

test.That(t, m.GoFor(ctx, -50, 0, nil), test.ShouldBeNil)
test.That(t, mustGetGPIOPinByName(b, "1").Get(context.Background()), test.ShouldEqual, false)
test.That(t, mustGetGPIOPinByName(b, "3").PWM(context.Background()), test.ShouldEqual, .5)
test.That(t, mustGetGPIOPinByName(b, "3").PWM(context.Background()), test.ShouldEqual, 0)

test.That(t, m.Stop(context.Background(), nil), test.ShouldBeNil)
})
Expand Down

0 comments on commit 1e1b14f

Please sign in to comment.