From 53ef574f899312150d203e13036873f5d880059f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20P=C3=A9rez?= Date: Mon, 13 Jul 2026 17:54:45 -0400 Subject: [PATCH] fix: ruff cleanup and missing DV3K_PRODID_REQ import in TTS tests Remove unused imports, sort import blocks, and import DV3K_PRODID_REQ used by the AMBEServer timeout mock in test_tts_engine_serial. --- src/adn_server/application/voice_use_cases.py | 1 - src/adn_server/infrastructure/twisted_adapters/udp_hbp.py | 2 +- tests/infrastructure/test_obp_proxy.py | 2 +- tests/voice/test_tts_engine_serial.py | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/adn_server/application/voice_use_cases.py b/src/adn_server/application/voice_use_cases.py index 2408eb5..9a5e739 100644 --- a/src/adn_server/application/voice_use_cases.py +++ b/src/adn_server/application/voice_use_cases.py @@ -35,7 +35,6 @@ from ..domain import HBPF_SLT_VHEAD, HBPF_SLT_VTERM, bytes_3, bytes_4, int_id from .ports import VoiceProvider from .server_voice import ( announcement_item_source_bytes, - server_voice_id, server_voice_rf_src_bytes, ) diff --git a/src/adn_server/infrastructure/twisted_adapters/udp_hbp.py b/src/adn_server/infrastructure/twisted_adapters/udp_hbp.py index 5829bcf..35cae61 100644 --- a/src/adn_server/infrastructure/twisted_adapters/udp_hbp.py +++ b/src/adn_server/infrastructure/twisted_adapters/udp_hbp.py @@ -39,7 +39,6 @@ from twisted.internet import reactor, task from twisted.internet.protocol import DatagramProtocol from ...application.proxy.deployment import is_proxy_inject_only -from ...application.server_voice import all_server_voice_ids from ...application.routing.downlink import ( DownlinkContext, iter_downlink_voice_slots, @@ -74,6 +73,7 @@ from ...application.routing.peer_downlink_index import ( count_connected_peers, invalidate_peer_options_cache, ) +from ...application.server_voice import all_server_voice_ids from ...domain import bytes_3, bytes_4, int_id from ...domain.dmr import decode from ...domain.dmr.const import LC_OPT diff --git a/tests/infrastructure/test_obp_proxy.py b/tests/infrastructure/test_obp_proxy.py index 51ba892..846e551 100644 --- a/tests/infrastructure/test_obp_proxy.py +++ b/tests/infrastructure/test_obp_proxy.py @@ -39,7 +39,6 @@ from adn_server.infrastructure.config_validator import validate_config from adn_server.infrastructure.hbp_constants import DMRD from adn_server.infrastructure.mesh.obp_v1 import build_bcka, build_dmrd_v1 from adn_server.infrastructure.proxy.obp_config import obp_proxy_settings -from adn_server.infrastructure.proxy.obp_runtime import build_obp_bridge_registry from adn_server.infrastructure.proxy.obp_fanin import ( InProcessObpSink, ObpBridgeEntry, @@ -47,6 +46,7 @@ from adn_server.infrastructure.proxy.obp_fanin import ( ObpFanInDemux, ObpIngressReplyTransport, ) +from adn_server.infrastructure.proxy.obp_runtime import build_obp_bridge_registry _PASS = b"test-passphrase\x00\x00\x00\x00\x00\x00" _NETWORK = bytes_4(73044) diff --git a/tests/voice/test_tts_engine_serial.py b/tests/voice/test_tts_engine_serial.py index 742dcc6..9e82582 100644 --- a/tests/voice/test_tts_engine_serial.py +++ b/tests/voice/test_tts_engine_serial.py @@ -28,7 +28,7 @@ import time import wave from adn_server.infrastructure.voice import tts_engine -from adn_server.infrastructure.voice.tts_engine import DV3K_SAMPLES_PER_FRAME +from adn_server.infrastructure.voice.tts_engine import DV3K_PRODID_REQ, DV3K_SAMPLES_PER_FRAME def test_text_to_ambe_serializes_parallel_conversions(tmp_path, monkeypatch) -> None: