Exemplo n.º 1
0
def test_mode():
    assert GPIO.getmode() is None
    GPIO.setmode(GPIO.BCM)
    assert GPIO.getmode() == GPIO.BCM
    GPIO.cleanup()
    assert GPIO.getmode() is None
    with pytest.raises(AssertionError):
        GPIO.setmode("Sausages")
Exemplo n.º 2
0
def setup():
    with patch("LPi.GPIO.sysfs"):
        GPIO.cleanup()