From 841798768d00d2e15b4fab41c15a293f5e2a6458 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 12 Sep 2023 04:04:02 -0700 Subject: [PATCH] fix --- messaging/__init__.py | 4 ++-- messaging/tests/test_messaging.py | 4 ++-- messaging/tests/test_services.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/messaging/__init__.py b/messaging/__init__.py index fd9a48772..57675212f 100644 --- a/messaging/__init__.py +++ b/messaging/__init__.py @@ -11,7 +11,7 @@ from collections import deque from cereal import log -from cereal.services import service_list +from cereal.services import SERVICE_LIST assert MultiplePublishersError assert MessagingError @@ -180,7 +180,7 @@ def __init__(self, services: List[str], poll: Optional[List[str]] = None, if addr is not None: p = self.poller if s not in self.non_polled_services else None self.sock[s] = sub_sock(s, poller=p, addr=addr, conflate=True) - self.freq[s] = service_list[s].frequency + self.freq[s] = SERVICE_LIST[s].frequency try: data = new_message(s) diff --git a/messaging/tests/test_messaging.py b/messaging/tests/test_messaging.py index 063351b75..f9c85e0dc 100755 --- a/messaging/tests/test_messaging.py +++ b/messaging/tests/test_messaging.py @@ -11,9 +11,9 @@ from cereal import log, car import cereal.messaging as messaging -from cereal.services import service_list +from cereal.services import SERVICE_LIST -events = [evt for evt in log.Event.schema.union_fields if evt in service_list.keys()] +events = [evt for evt in log.Event.schema.union_fields if evt in SERVICE_LIST.keys()] def random_sock(): return random.choice(events) diff --git a/messaging/tests/test_services.py b/messaging/tests/test_services.py index 6452b5b6e..f26bdbc5f 100755 --- a/messaging/tests/test_services.py +++ b/messaging/tests/test_services.py @@ -6,21 +6,21 @@ from parameterized import parameterized import cereal.services as services -from cereal.services import service_list, RESERVED_PORT, STARTING_PORT +from cereal.services import SERVICE_LIST, RESERVED_PORT, STARTING_PORT class TestServices(unittest.TestCase): - @parameterized.expand(service_list.keys()) + @parameterized.expand(SERVICE_LIST.keys()) def test_services(self, s): - service = service_list[s] + service = SERVICE_LIST[s] self.assertTrue(service.port != RESERVED_PORT) self.assertTrue(service.port >= STARTING_PORT) self.assertTrue(service.frequency <= 104) def test_no_duplicate_port(self): ports: Dict[int, str] = {} - for name, service in service_list.items(): + for name, service in SERVICE_LIST.items(): self.assertFalse(service.port in ports.keys(), f"duplicate port {service.port}") ports[service.port] = name