Esempio n. 1
0
    def test_should_turn_Left_and_then_turn_right(self):
        shoulder = Motor(0, 0)

        shoulder.turn_right()
        self.assertEqual(True, shoulder.pin_b.value)
        self.assertEqual(False, shoulder.pin_a.value)

        shoulder.turn_left()
        self.assertEqual(True, shoulder.pin_a.value)
        self.assertEqual(False, shoulder.pin_b.value)

        self.assertTrue(shoulder.is_on())
Esempio n. 2
0
    def test_should_turn_right_02_degrees(self):
        executor = RPiExecutor()
        motor = Motor(0, 0)
        control = Control(motor, executor, None)

        motor.turn_right = MagicMock()
        motor.stop = MagicMock()
        executor.move = MagicMock()

        control.turn_right(10)

        executor.move.assert_called_with(motor)
        motor.turn_right.assert_called_with()
        motor.stop.assert_called_with()