Beispiel #1
0
    def test_given_a_message_when_write_then_checksum_added(self):
        self.serial.write = Mock()
        channel = Channel(self.serial, MagicMock())

        channel.send_command(self.message)

        self.serial.write.assert_called_once_with(self.expected_sent_message)
Beispiel #2
0
    def test_when_write_then_calls_write_on_port(self):
        self.serial.write = Mock()
        channel = Channel(self.serial, MagicMock())

        channel.send_command(self.message)

        self.serial.write.assert_called_once()