Exemplo n.º 1
0
    def test_when_receive_message_from_stm_then_append_it_to_queue(self):
        ctrl = RobotController(MagicMock(), MagicMock(), MagicMock(),
                               MagicMock())

        ctrl.receive_stm_command()

        self.assertEqual(1, len(ctrl._stm_responses_deque))
Exemplo n.º 2
0
    def test_when_receive_message_from_stm_then_receive_from_channel(self):
        channel = MagicMock()
        channel.attach_mock(
            Mock(return_value=commands_from_stm.Feedback(
                commands_from_stm.Message.TASK_RECEIVED_ACK.value)),
            'receive_message')
        ctrl = RobotController(MagicMock(), MagicMock(), MagicMock(), channel)

        ctrl.receive_stm_command()

        channel.receive_message.assert_called_once()