selfdrive.controls.tests package

Submodules

selfdrive.controls.tests.test_alerts module

class selfdrive.controls.tests.test_alerts.TestAlerts(methodName='runTest')[source]

Bases: TestCase

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

test_alert_sanity_check()[source]
test_alert_text_length()[source]
test_events_defined()[source]
test_offroad_alerts()[source]
test_offroad_alerts_extra_text()[source]

selfdrive.controls.tests.test_cruise_speed module

class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed(methodName='runTest')[source]

Bases: TestCase

class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_0_aggressive(methodName='runTest')

Bases: TestCruiseSpeed

e2e = True
personality = 'aggressive'
speed = 5
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_10_relaxed(methodName='runTest')

Bases: TestCruiseSpeed

e2e = False
personality = 'relaxed'
speed = 5
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_11_relaxed(methodName='runTest')

Bases: TestCruiseSpeed

e2e = False
personality = 'relaxed'
speed = 35
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_1_aggressive(methodName='runTest')

Bases: TestCruiseSpeed

e2e = True
personality = 'aggressive'
speed = 35
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_2_standard(methodName='runTest')

Bases: TestCruiseSpeed

e2e = True
personality = 'standard'
speed = 5
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_3_standard(methodName='runTest')

Bases: TestCruiseSpeed

e2e = True
personality = 'standard'
speed = 35
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_4_relaxed(methodName='runTest')

Bases: TestCruiseSpeed

e2e = True
personality = 'relaxed'
speed = 5
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_5_relaxed(methodName='runTest')

Bases: TestCruiseSpeed

e2e = True
personality = 'relaxed'
speed = 35
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_6_aggressive(methodName='runTest')

Bases: TestCruiseSpeed

e2e = False
personality = 'aggressive'
speed = 5
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_7_aggressive(methodName='runTest')

Bases: TestCruiseSpeed

e2e = False
personality = 'aggressive'
speed = 35
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_8_standard(methodName='runTest')

Bases: TestCruiseSpeed

e2e = False
personality = 'standard'
speed = 5
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestCruiseSpeed_9_standard(methodName='runTest')

Bases: TestCruiseSpeed

e2e = False
personality = 'standard'
speed = 35
test_cruise_speed()
class selfdrive.controls.tests.test_cruise_speed.TestVCruiseHelper(methodName='runTest')[source]

Bases: TestCase

enable(v_ego, experimental_mode)[source]
reset_cruise_speed_state()[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

class selfdrive.controls.tests.test_cruise_speed.TestVCruiseHelper_0(methodName='runTest')

Bases: TestVCruiseHelper

enable(v_ego, experimental_mode)
pcm_cruise = False
reset_cruise_speed_state()
setUp()

Hook method for setting up the test fixture before exercising it.

test_adjust_speed()

Asserts speed changes on falling edges of buttons.

test_initialize_v_cruise()

Asserts allowed cruise speeds on enabling with SET.

test_resume_in_standstill()

Asserts we don’t increment set speed if user presses resume/accel to exit cruise standstill.

test_rising_edge_enable()

Some car interfaces may enable on rising edge of a button, ensure we don’t adjust speed if enabled changes mid-press.

test_set_gas_pressed()

Asserts pressing set while enabled with gas pressed sets the speed to the maximum of vEgo and current cruise speed.

selfdrive.controls.tests.test_cruise_speed.run_cruise_simulation(cruise, e2e, personality, t_end=20.0)[source]

selfdrive.controls.tests.test_following_distance module

class selfdrive.controls.tests.test_following_distance.TestFollowingDistance(methodName='runTest')[source]

Bases: TestCase

class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_0(methodName='runTest')

Bases: TestFollowingDistance

e2e = True
personality = 2
speed = 0
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_1(methodName='runTest')

Bases: TestFollowingDistance

e2e = True
personality = 2
speed = 10
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_10(methodName='runTest')

Bases: TestFollowingDistance

e2e = False
personality = 2
speed = 10
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_11(methodName='runTest')

Bases: TestFollowingDistance

e2e = False
personality = 2
speed = 35
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_12(methodName='runTest')

Bases: TestFollowingDistance

e2e = False
personality = 1
speed = 0
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_13(methodName='runTest')

Bases: TestFollowingDistance

e2e = False
personality = 1
speed = 10
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_14(methodName='runTest')

Bases: TestFollowingDistance

e2e = False
personality = 1
speed = 35
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_15(methodName='runTest')

Bases: TestFollowingDistance

e2e = False
personality = 0
speed = 0
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_16(methodName='runTest')

Bases: TestFollowingDistance

e2e = False
personality = 0
speed = 10
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_17(methodName='runTest')

Bases: TestFollowingDistance

e2e = False
personality = 0
speed = 35
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_2(methodName='runTest')

Bases: TestFollowingDistance

e2e = True
personality = 2
speed = 35
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_3(methodName='runTest')

Bases: TestFollowingDistance

e2e = True
personality = 1
speed = 0
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_4(methodName='runTest')

Bases: TestFollowingDistance

e2e = True
personality = 1
speed = 10
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_5(methodName='runTest')

Bases: TestFollowingDistance

e2e = True
personality = 1
speed = 35
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_6(methodName='runTest')

Bases: TestFollowingDistance

e2e = True
personality = 0
speed = 0
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_7(methodName='runTest')

Bases: TestFollowingDistance

e2e = True
personality = 0
speed = 10
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_8(methodName='runTest')

Bases: TestFollowingDistance

e2e = True
personality = 0
speed = 35
test_following_distance()
class selfdrive.controls.tests.test_following_distance.TestFollowingDistance_9(methodName='runTest')

Bases: TestFollowingDistance

e2e = False
personality = 2
speed = 0
test_following_distance()
selfdrive.controls.tests.test_following_distance.run_following_distance_simulation(v_lead, t_end=100.0, e2e=False, personality=0)[source]

selfdrive.controls.tests.test_lateral_mpc module

class selfdrive.controls.tests.test_lateral_mpc.TestLateralMpc(methodName='runTest')[source]

Bases: TestCase

test_curvature_symmetry()[source]
test_no_overshoot()[source]
test_poly_symmetry()[source]
test_psi_symmetry()[source]
test_straight()[source]
test_switch_convergence()[source]
test_y_symmetry()[source]
selfdrive.controls.tests.test_lateral_mpc.run_mpc(lat_mpc=None, v_ref=30.0, x_init=0.0, y_init=0.0, psi_init=0.0, curvature_init=0.0, lane_width=3.6, poly_shift=0.0)[source]

selfdrive.controls.tests.test_leads module

class selfdrive.controls.tests.test_leads.TestLeads(methodName='runTest')[source]

Bases: TestCase

test_radar_fault()[source]

selfdrive.controls.tests.test_startup module

selfdrive.controls.tests.test_startup.test_startup_alert_0(*a)
selfdrive.controls.tests.test_startup.test_startup_alert_1(*a)
selfdrive.controls.tests.test_startup.test_startup_alert_2(*a)
selfdrive.controls.tests.test_startup.test_startup_alert_3(*a)
selfdrive.controls.tests.test_startup.test_startup_alert_4(*a)
selfdrive.controls.tests.test_startup.test_startup_alert_5(*a)
selfdrive.controls.tests.test_startup.test_startup_alert_6(*a)
selfdrive.controls.tests.test_startup.test_startup_alert_7(*a)
selfdrive.controls.tests.test_startup.test_startup_alert_8(*a)
selfdrive.controls.tests.test_startup.test_startup_alert_9(*a)

selfdrive.controls.tests.test_state_machine module

class selfdrive.controls.tests.test_state_machine.TestStateMachine(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_immediate_disable()[source]
test_maintain_states()[source]
test_no_entry()[source]
test_no_entry_pre_enable()[source]
test_soft_disable()[source]
test_soft_disable_timer()[source]
test_user_disable()[source]
selfdrive.controls.tests.test_state_machine.make_event(event_types)[source]

Module contents