mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-24 23:42:05 +08:00
Revert "interfaces: test interface attributes (#29297)"
This reverts commit 6a678cde6c.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user