Skip to content

Commit

Permalink
Fix code paths -- on() should succeed and off() should fail
Browse files Browse the repository at this point in the history
  • Loading branch information
n8henrie committed Feb 19, 2024
1 parent ec9abf0 commit 61e6b40
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/test_commandlineplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,9 @@ def test_commandlineplugin_fake_state() -> None:
state = device.get_state()
assert state == conf_initial_state

if device.on():
assert device.get_state() == "on"
else:
assert device.get_state() == state
# Tests are arranged so that `on()` succeeds and `off()` fails
assert device.on()
assert device.get_state() == "on"

state = device.get_state()
if device.off():
assert device.get_state() == "off"
else:
assert device.get_state() == state
assert not device.off()
assert device.get_state() == "on"

0 comments on commit 61e6b40

Please sign in to comment.