mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 07:13:40 +08:00
Keep regression fixtures valid under CI checks
This commit is contained in:
@@ -203,7 +203,7 @@ def test_internal_panda_ready_without_udev(tmp_path, device, ids):
|
||||
(usb / name).write_text(value)
|
||||
access = Mock(return_value=True)
|
||||
clock = Mock(monotonic=Mock(return_value=0), sleep=Mock())
|
||||
namespace = {'HARDWARE': SimpleNamespace(get_device_type=lambda: device), 'Path': lambda _: usb,
|
||||
namespace: dict = {'HARDWARE': SimpleNamespace(get_device_type=lambda: device), 'Path': lambda _: usb,
|
||||
'Panda': SimpleNamespace(USB_VIDS=(0xbbaa, 0x3801), USB_PIDS=(0xddee, 0xddcc)),
|
||||
'os': SimpleNamespace(access=access, R_OK=4, W_OK=2), 'time': clock,
|
||||
'subprocess': SimpleNamespace(run=Mock(side_effect=FileNotFoundError('udevadm')))}
|
||||
@@ -236,7 +236,7 @@ def test_internal_panda_readiness_refuses_unready_device(tmp_path, failure):
|
||||
for name, value in values.items():
|
||||
(usb / name).write_text(value)
|
||||
clock = Mock(monotonic=Mock(side_effect=[0, 0, 0.01, 0.02]), sleep=Mock())
|
||||
namespace = {'HARDWARE': SimpleNamespace(get_device_type=lambda: 'tici'), 'Path': lambda _: usb,
|
||||
namespace: dict = {'HARDWARE': SimpleNamespace(get_device_type=lambda: 'tici'), 'Path': lambda _: usb,
|
||||
'Panda': SimpleNamespace(USB_VIDS=(0xbbaa, 0x3801), USB_PIDS=(0xddee, 0xddcc)),
|
||||
'os': SimpleNamespace(access=Mock(return_value=failure != 'no_access'), R_OK=4, W_OK=2), 'time': clock,
|
||||
'subprocess': SimpleNamespace(run=Mock(side_effect=FileNotFoundError('udevadm')))}
|
||||
@@ -254,7 +254,7 @@ def test_internal_panda_readiness_waits_for_read_write_permission(tmp_path):
|
||||
(usb / name).write_text(value)
|
||||
clock = Mock(monotonic=Mock(return_value=0), sleep=Mock())
|
||||
access = Mock(side_effect=[False, True])
|
||||
namespace = {'HARDWARE': SimpleNamespace(get_device_type=lambda: 'tici'), 'Path': lambda _: usb,
|
||||
namespace: dict = {'HARDWARE': SimpleNamespace(get_device_type=lambda: 'tici'), 'Path': lambda _: usb,
|
||||
'Panda': SimpleNamespace(USB_VIDS=(0xbbaa, 0x3801), USB_PIDS=(0xddee, 0xddcc)),
|
||||
'os': SimpleNamespace(access=access, R_OK=4, W_OK=2), 'time': clock}
|
||||
exec(compile(ast.Module(body=[method], type_ignores=[]), 'pandad.py', 'exec'), namespace)
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -155,6 +155,7 @@ def test_idle_mapping_change_is_checked_before_a_new_press(context):
|
||||
params.put("DistanceButtonControl", 8, block=True)
|
||||
owner.observe(params, cp, state(), now_ns=NOW + 2_000_000_000, drive_id=DRIVE)
|
||||
assert not any(action for _, action in owner.observe(params, cp, state(True), now_ns=NOW + 2_010_000_000, drive_id=DRIVE))
|
||||
assert owner.mapping is not None
|
||||
assert owner.mapping["DistanceButtonControl"] == 8
|
||||
owner.observe(params, cp, state(False), now_ns=NOW + 2_020_000_000, drive_id=DRIVE)
|
||||
owner.observe(params, cp, state(True), now_ns=NOW + 2_030_000_000, drive_id=DRIVE)
|
||||
@@ -171,4 +172,5 @@ def test_held_button_keeps_periodic_revocation_checks(context):
|
||||
commands = owner.observe(params, cp, state(), now_ns=NOW + 1_020_000_000, drive_id=DRIVE)
|
||||
assert not any(action for _, action in commands)
|
||||
assert not owner.tracker.distance_held
|
||||
assert owner.mapping is not None
|
||||
assert owner.mapping["LongDistanceButtonControl"] == 0
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "561a160da3e08690d05e6fce7f195b969542a34bd9531f67d11dec140c36e6d5", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "1d778efd77f71f8821dcfeee63c424667049e51f6349a00b1fd3cb6a1a8ca688", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user