Пример #1
0
def test_output_blink_interrupt_off():
    pin = MockPin(2)
    with DigitalOutputDevice(pin) as device:
        device.blink(0.1, 1)
        sleep(0.2)
        device.off() # should interrupt while off
        pin.assert_states([False, True, False])
def test_output_blink_interrupt_off():
    pin = MockPin(2)
    with DigitalOutputDevice(pin) as device:
        device.blink(0.1, 1)
        sleep(0.2)
        device.off() # should interrupt while off
        pin.assert_states([False, True, False])
Пример #3
0
def test_output_blink_interrupt_on():
    pin = MockPin(2)
    device = DigitalOutputDevice(pin)
    device.blink(1, 0.1)
    sleep(0.2)
    device.off()  # should interrupt while on
    pin.assert_states([False, True, False])
Пример #4
0
def test_output_blink_interrupt_on():
    pin = MockPin(2)
    device = DigitalOutputDevice(pin)
    device.blink(1, 0.1)
    sleep(0.2)
    device.off() # should interrupt while on
    pin.assert_states([False, True, False])
def test_led_board_blink_interrupt_off():
    pin1 = MockPin(2)
    pin2 = MockPin(3)
    pin3 = MockPin(4)
    with LEDBoard(pin1, LEDBoard(pin2, pin3)) as board:
        board.blink(0.1, 1)
        sleep(0.2)
        board.off()  # should interrupt while off
        pin1.assert_states([False, True, False])
        pin2.assert_states([False, True, False])
        pin3.assert_states([False, True, False])
Пример #6
0
def test_led_board_blink_interrupt_off():
    pin1 = MockPin(2)
    pin2 = MockPin(3)
    pin3 = MockPin(4)
    with LEDBoard(pin1, LEDBoard(pin2, pin3)) as board:
        board.blink(0.1, 1)
        sleep(0.2)
        board.off() # should interrupt while off
        pin1.assert_states([False, True, False])
        pin2.assert_states([False, True, False])
        pin3.assert_states([False, True, False])