[真实链路自测]:完成完整流程自测和ACK缓冲修正,包含真实Provider验收、播放回声清理和回归测试

This commit is contained in:
mkbk
2026-06-17 23:47:21 +08:00
parent b3566c2424
commit b2822dc1af
10 changed files with 121 additions and 7 deletions
+8
View File
@@ -46,8 +46,16 @@ class TransportTests(unittest.TestCase):
transport = MemoryAudioTransport([frame(1, 0), frame(2, 20)])
transport.start_input()
self.assertEqual(transport.flush_input(), 2)
self.assertEqual(transport.flush_count, 1)
self.assertEqual(transport.read_frames(10), [])
def test_memory_transport_can_preserve_prefilled_frames_on_flush(self) -> None:
transport = MemoryAudioTransport([frame(1, 0), frame(2, 20)], flush_clears_input=False)
transport.start_input()
self.assertEqual(transport.flush_input(), 0)
self.assertEqual(transport.flush_count, 1)
self.assertEqual([f.frame_id for f in transport.read_frames(10)], [1])
def test_file_replay_roundtrip(self) -> None:
frames = [frame(1, 0, {"wake": True}), frame(2, 20, {"speech": True})]
with tempfile.TemporaryDirectory() as tmp: