Skip to content

Commit bdbff0e

Browse files
committed
Adapt testcode
1 parent cdf40d8 commit bdbff0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_usb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,10 @@ async def test_node_relay_and_power(self, monkeypatch: pytest.MonkeyPatch) -> No
784784
# Manually load node
785785
assert await stick.nodes["0098765432101234"].load()
786786

787+
# Check relay_lock is set to False when not in cache
788+
assert stick.nodes["0098765432101234"].relay_lock
789+
assert not stick.nodes["0098765432101234"].relay_lock.state
790+
787791
unsub_relay = stick.nodes["0098765432101234"].subscribe_to_feature_update(
788792
node_feature_callback=self.node_relay_state,
789793
features=(pw_api.NodeFeature.RELAY, pw_api.NodeFeature.RELAY_LOCK,),
@@ -797,7 +801,6 @@ async def test_node_relay_and_power(self, monkeypatch: pytest.MonkeyPatch) -> No
797801

798802
# Test blocked async switching due to relay-lock active
799803
await stick.nodes["0098765432101234"].set_relay_lock(True)
800-
assert stick.nodes["0098765432101234"].relay_lock
801804
assert stick.nodes["0098765432101234"].relay_lock.state
802805
with pytest.raises(pw_exceptions.NodeError):
803806
await stick.nodes["0098765432101234"].set_relay(True)

0 commit comments

Comments
 (0)