mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-08 13:33:42 +08:00
22a8575199
Keep official openpilot ancestry and dependency licenses. Store resources directly in Git, remove LFS setup requirements, and leave the downloadable big model outside the source tree.
22 lines
572 B
Python
22 lines
572 B
Python
import time
|
|
|
|
from opendbc.car.structs import CarParams
|
|
from panda.tests.hitl.base import PandaTestCase
|
|
|
|
|
|
class TestSafety(PandaTestCase):
|
|
def test_safety_nooutput(self):
|
|
p = self.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
|