IQ.Pilot Release Commit @ b6534c0

This commit is contained in:
IQ.Lvbs CI [bot]
2026-08-27 20:17:33 -05:00
commit 00f07cac48
4706 changed files with 1257146 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
from types import SimpleNamespace
from iqpilot.cereal import car
from iqpilot.selfdrive.ui import soundd
AudibleAlert = car.CarControl.HUDControl.AudibleAlert
class TestSoundd:
def test_check_selfdrive_timeout_alert(self, monkeypatch):
class FakeSubMaster:
recv_time = {'selfdriveState': 100.0}
def __init__(self, enabled):
self.state = SimpleNamespace(enabled=enabled)
def __getitem__(self, service):
assert service == 'selfdriveState'
return self.state
enabled = FakeSubMaster(True)
disabled = FakeSubMaster(False)
monkeypatch.setattr(soundd.time, "monotonic", lambda: 100.0 + soundd.SELFDRIVE_STATE_TIMEOUT)
assert not soundd.check_selfdrive_timeout_alert(enabled)
monkeypatch.setattr(soundd.time, "monotonic", lambda: 101.0 + soundd.SELFDRIVE_STATE_TIMEOUT)
assert soundd.check_selfdrive_timeout_alert(enabled)
assert not soundd.check_selfdrive_timeout_alert(disabled)
monkeypatch.setattr(soundd.time, "monotonic", lambda: 110.0 + soundd.SELFDRIVE_STATE_TIMEOUT)
assert not soundd.check_selfdrive_timeout_alert(enabled)
# TODO: add test with micd for checking that soundd actually outputs sounds