Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty committed Jun 24, 2024
1 parent 5542347 commit c2c22d0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@ def test_onFalse(scheduler: commands2.CommandScheduler):
assert not command1.isScheduled()


def test_onChange(scheduler: commands2.CommandScheduler):
finished = OOBoolean(False)
command1 = commands2.WaitUntilCommand(finished)

button = InternalButton()
button.setPressed(True)
button.onChange(command1)
scheduler.run()
assert not command1.isScheduled()
button.setPressed(False)
scheduler.run()
assert command1.isScheduled()
finished.set(True)
scheduler.run()
assert command1.isScheduled()


def test_whileTrueRepeatedly(scheduler: commands2.CommandScheduler):
inits = OOInteger(0)
counter = OOInteger(0)
Expand Down

0 comments on commit c2c22d0

Please sign in to comment.