mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-18 10:23:43 +08:00
lint
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from types import SimpleNamespace
|
||||
from typing import cast
|
||||
|
||||
from openpilot.common.test import OpenpilotTestCase
|
||||
from openpilot.cereal import custom
|
||||
@@ -51,12 +52,12 @@ class TestStoppingHold:
|
||||
def test_weak_brake_does_not_hold_stopping(self):
|
||||
control = SimpleNamespace(last_output_accel=-0.109)
|
||||
car_state = SimpleNamespace(vEgo=0.277, aEgo=-0.406)
|
||||
assert not LongControlSP.should_hold_stopping(control, car_state, -0.072)
|
||||
assert not LongControlSP.should_hold_stopping(cast(LongControlSP, control), car_state, -0.072)
|
||||
|
||||
def test_sufficient_brake_holds_stopping(self):
|
||||
control = SimpleNamespace(last_output_accel=-0.543)
|
||||
car_state = SimpleNamespace(vEgo=0.209, aEgo=-0.534)
|
||||
assert LongControlSP.should_hold_stopping(control, car_state, -0.469)
|
||||
assert LongControlSP.should_hold_stopping(cast(LongControlSP, control), car_state, -0.469)
|
||||
|
||||
def test_stopping_decel_rate_is_smooth_while_rolling(self):
|
||||
assert LongControlSP.stopping_decel_rate(0.1) == 0.3
|
||||
|
||||
Reference in New Issue
Block a user