Revert "interfaces: test interface attributes (#29297)"

This reverts commit 55af4cce3d3955ca0ecdb98517089a0a42b53ad2.

old-commit-hash: 51831d03a3
beeps
Adeeb Shihadeh 2 years ago
parent cfa3ff0fba
commit a55a8849b3
  1. 27
      selfdrive/car/tests/test_car_interfaces.py

@ -11,7 +11,6 @@ from common.realtime import DT_CTRL
from selfdrive.car import gen_empty_fingerprint
from selfdrive.car.car_helpers import interfaces
from selfdrive.car.fingerprints import all_known_cars
from selfdrive.car.interfaces import get_interface_attr
from selfdrive.test.fuzzy_generation import DrawType, FuzzyGenerator
@ -110,31 +109,5 @@ class TestCarInterfaces(unittest.TestCase):
hasattr(radar_interface, '_update') and hasattr(radar_interface, 'trigger_msg'):
radar_interface._update([radar_interface.trigger_msg])
def test_interface_attrs(self):
"""Asserts basic behavior of interface attribute getter"""
num_brands = len(get_interface_attr('CAR'))
self.assertGreaterEqual(num_brands, 13)
# Should return value for all brands when not combining, even if attribute doesn't exist
ret = get_interface_attr('FAKE_ATTR')
self.assertEqual(len(ret), num_brands)
# Make sure we can combine dicts
ret = get_interface_attr('DBC', combine_brands=True)
self.assertGreaterEqual(len(ret), 170)
# We don't support combining non-dicts
ret = get_interface_attr('CAR', combine_brands=True)
self.assertEqual(len(ret), 0)
# If brand has None value, it shouldn't return when ignore_none=True is specified
none_brands = {b for b, v in get_interface_attr('FINGERPRINTS').items() if v is None}
self.assertGreaterEqual(len(none_brands), 1)
ret = get_interface_attr('FINGERPRINTS', ignore_none=True)
none_brands_in_ret = none_brands.intersection(ret)
self.assertEqual(len(none_brands_in_ret), 0, f'Brands with None values in ignore_none=True result: {none_brands_in_ret}')
if __name__ == "__main__":
unittest.main()

Loading…
Cancel
Save