def test_should_turn_off_led(self): executor = RPiExecutor() pin = Pin(21) pin.off = MagicMock() executor.go = MagicMock() control = Control(None, executor, pin) control.turn_off_led() pin.off.assert_called_with() executor.go.assert_called_with(pin)
def test_should_return_true_when_call_off(self): pin = Pin(1) pin.off() self.assertFalse(pin.value)