"""Audio receipt and preview safety, without models or network services.""" import json,struct,unittest from types import SimpleNamespace from unittest.mock import AsyncMock,patch,Mock import numpy as np from aiohttp import WSMsgType from server import RoboConversation,Conversation class AudioInputTests(unittest.IsolatedAsyncioTestCase): def conversation(self): c=RoboConversation.__new__(RoboConversation) c.ws=SimpleNamespace(send_json=AsyncMock()) c.input_samples=0;c.input_blocks=0;c.last_input_notice=0. c.pending_barge_proposal=None c._send_turn=AsyncMock() return c async def test_receipt_ack_has_level_and_duration_but_no_audio(self): c=self.conversation();pcm=np.full(320,3277,'