def test_set_frequency_invalid_rfm(self): mock = MagicMock() l = LaCrosse('/dev/ttyTEST', 115200) l._serial.write = mock l.set_frequency(500, rfm=3) l._serial.write.assert_called_with(b'400f')
def test_set_frequency(self): mock = MagicMock() l = LaCrosse('/dev/ttyTEST', 115200) l._serial.write = mock l.set_frequency(100) l._serial.write.assert_called_with(b'100f') l.set_frequency('200') l._serial.write.assert_called_with(b'200f') l.set_frequency(300, rfm=1) l._serial.write.assert_called_with(b'300f') l.set_frequency(400, rfm=2) l._serial.write.assert_called_with(b'400F')