mirror of
https://jihulab.com/mr-one/openpilot.git
synced 2026-10-31 02:54:14 +08:00
f8e13417f2
date: 2026-08-15T14:20:10 master commit: d48cfa730bf21593b684efeaf3fd8940695e1dea
19 lines
451 B
Python
19 lines
451 B
Python
import time
|
|
|
|
from opendbc.car.structs import CarParams
|
|
|
|
|
|
def test_safety_nooutput(p):
|
|
p.set_safety_mode(CarParams.SafetyModel.silent)
|
|
p.set_can_loopback(True)
|
|
|
|
# send a message on bus 0
|
|
p.can_send(0x1aa, b"message", 0)
|
|
|
|
# confirm receive nothing
|
|
time.sleep(0.05)
|
|
r = p.can_recv()
|
|
# bus 192 is messages blocked by TX safety hook on bus 0
|
|
assert len([x for x in r if x[2] != 192]) == 0
|
|
assert len([x for x in r if x[2] == 192]) == 1
|