mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
ugpio plugins
This commit is contained in:
@@ -29,7 +29,7 @@ from kvmd import gpio
|
||||
@pytest.mark.parametrize("pin", [0, 1, 13])
|
||||
def test_ok__loopback_initial_false(pin: int) -> None:
|
||||
with gpio.bcm():
|
||||
assert gpio.set_output(pin) == pin
|
||||
assert gpio.set_output(pin, False) == pin
|
||||
assert gpio.read(pin) is False
|
||||
gpio.write(pin, True)
|
||||
assert gpio.read(pin) is True
|
||||
@@ -53,6 +53,6 @@ def test_ok__input(pin: int) -> None:
|
||||
|
||||
def test_fail__invalid_pin() -> None:
|
||||
with pytest.raises(AssertionError):
|
||||
gpio.set_output(-1)
|
||||
gpio.set_output(-1, False)
|
||||
with pytest.raises(AssertionError):
|
||||
gpio.set_input(-1)
|
||||
|
||||
Reference in New Issue
Block a user