예제 #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")
예제 #2
0
def setup():
    with patch("LPi.GPIO.sysfs"):
        GPIO.cleanup()