From 548c801313aad0b57ef63ab812144d712959f1f5 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 8 Dec 2022 20:11:02 -0800 Subject: [PATCH] assert we only add angle control to TSS2 cars --- selfdrive/car/toyota/tests/test_toyota.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 selfdrive/car/toyota/tests/test_toyota.py diff --git a/selfdrive/car/toyota/tests/test_toyota.py b/selfdrive/car/toyota/tests/test_toyota.py new file mode 100755 index 0000000000..fa8dc78c50 --- /dev/null +++ b/selfdrive/car/toyota/tests/test_toyota.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from parameterized import parameterized +import unittest + +from cereal import car +from selfdrive.car.toyota.values import FW_VERSIONS, TSS2_CAR +from selfdrive.car.toyota.interface import CarInterface + + +class TestToyotaInterfaces(unittest.TestCase): + @parameterized.expand([(car,) for car in FW_VERSIONS.keys()]) + def test_toyota_interfaces(self, car_name): + car_params = CarInterface.get_params(car_name) + assert car_params + + if car_params.steerControlType == car.CarParams.SteerControlType.angle: + self.assertIn(car_name, TSS2_CAR) + + +if __name__ == "__main__": + unittest.main()