[copybara] Sync with mostrobotpy (#8820)

GitOrigin-RevId: f03f29e57af22a74b680873090028b9c9f5c8063
This commit is contained in:
PJ Reiniger
2026-04-26 11:25:15 -04:00
committed by GitHub
parent af7d68e993
commit e5980b46ef
16 changed files with 75 additions and 41 deletions

View File

@@ -18,11 +18,7 @@ def group_name(request):
def get_active_alerts(level: Alert.Level) -> T.List[str]:
return [
a.text
for a in AlertSim.getAll()
if a.level == level and a.isActive()
]
return [a.text for a in AlertSim.getAll() if a.level == level and a.isActive()]
def is_alert_active(text: str, level: Alert.Level):
@@ -144,6 +140,7 @@ def test_set_text_while_set(group_name):
assert not is_alert_active("BEFORE", Alert.Level.LOW)
assert is_alert_active("AFTER", Alert.Level.LOW)
def test_get_active(group_name):
with (
Alert(group_name, "A", Alert.Level.HIGH) as a,
@@ -154,10 +151,10 @@ def test_get_active(group_name):
a.set(True)
b.set(True)
c.set(False)
active = AlertSim.getActive()
allAlerts = AlertSim.getAll()
assert len(active) == 2
assert len(allAlerts) == 3
@@ -169,4 +166,4 @@ def test_get_active(group_name):
allAlerts = AlertSim.getAll()
assert len(active) == 1
assert len(allAlerts) == 3
assert active[0].text == "B"
assert active[0].text == "B"