Files
StarPilot/openpilot/selfdrive/car/tests/test_alpha_long_saved_intent.py
T
firestar5683 a82935f326 User interfaces and Android Auto
Integrate onroad views, configurable widgets, local settings, steering-profile contracts, Bluetooth and Android Auto with their device and runtime services.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: DimitriChrysafis <Dimitri.chrysafis@gmail.com>
Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
Co-authored-by: stef <19478336+stefpi@users.noreply.github.com>
Co-authored-by: whoisdomi <dcantu83@gmail.com>

Co-authored-by: Intelli <contact@intelli.software>
Co-authored-by: pharmacomaniac <blittle65@gmail.com>

Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 20:02:39 -05:00

19 lines
799 B
Python

from pathlib import Path
import pytest
from openpilot.common.params import Params
from openpilot.selfdrive.car.card import alpha_long_requested
@pytest.mark.parametrize('release', [False, True])
@pytest.mark.parametrize('raw', [None, b'0', b'1'])
def test_retained_choice_is_separate_from_release_runtime_authority(tmp_path, release, raw):
params = Params(str(tmp_path))
path = Path(params.get_param_path('AlphaLongitudinalEnabled'))
if raw is not None:
path.write_bytes(raw)
assert alpha_long_requested(params, is_release=release) == (raw == b'1' and not release)
assert (path.read_bytes() if path.exists() else None) == raw
# Returning to a supported development branch restores intent without a rewrite.
assert alpha_long_requested(params, is_release=False) == (raw == b'1')