mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-29 02:22:09 +08:00
Add test that gets all the car params
old-commit-hash: 16b6c70884f870461cd3fa7d18daf61faa5c25d0
This commit is contained in:
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python3
|
||||
import unittest
|
||||
from selfdrive.car.fingerprints import all_known_cars
|
||||
from selfdrive.car.car_helpers import interfaces
|
||||
from selfdrive.car.fingerprints import _FINGERPRINTS as FINGERPRINTS
|
||||
|
||||
|
||||
class TestCarParam(unittest.TestCase):
|
||||
def test_creating_car_params(self):
|
||||
all_cars = all_known_cars()
|
||||
|
||||
for car in all_cars:
|
||||
fingerprint = FINGERPRINTS[car][0]
|
||||
|
||||
CarInterface, CarController, CarState = interfaces[car]
|
||||
fingerprints = {
|
||||
0: fingerprint,
|
||||
1: fingerprint,
|
||||
2: fingerprint,
|
||||
}
|
||||
|
||||
car_fw = []
|
||||
|
||||
for has_relay in [True, False]:
|
||||
car_params = CarInterface.get_params(car, fingerprints, has_relay, car_fw)
|
||||
car_interface = CarInterface(car_params, CarController, CarState), car_params
|
||||
|
||||
assert car_params
|
||||
assert car_interface
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user