mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Project import generated by Copybara. GitOrigin-RevId: 715c8e8372d936f447f2937aab6b1a22dc619126
23 lines
514 B
Python
23 lines
514 B
Python
from typing import TYPE_CHECKING
|
|
|
|
import commands2
|
|
from util import * # type: ignore
|
|
|
|
if TYPE_CHECKING:
|
|
from .util import *
|
|
|
|
import pytest
|
|
|
|
|
|
def test_notifierCommandScheduler(scheduler: commands2.CommandScheduler):
|
|
with ManualSimTime() as sim:
|
|
counter = OOInteger(0)
|
|
command = commands2.NotifierCommand(counter.incrementAndGet, 0.01)
|
|
|
|
scheduler.schedule(command)
|
|
for i in range(5):
|
|
sim.step(0.005)
|
|
scheduler.cancel(command)
|
|
|
|
assert counter == 2
|