From 1e1b14f2db90479cd82491e6f19a1bef8173f6ca Mon Sep 17 00:00:00 2001 From: martha-johnston Date: Tue, 3 Sep 2024 11:56:13 -0400 Subject: [PATCH] fix basic motor tests --- components/motor/gpio/basic_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/motor/gpio/basic_test.go b/components/motor/gpio/basic_test.go index 8059e4c0cbc..29289cafb6b 100644 --- a/components/motor/gpio/basic_test.go +++ b/components/motor/gpio/basic_test.go @@ -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) @@ -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) })