[TTS] Add missing _generate_pcm_chunks for OmniOpenAIServingSpeech streaming (#2569)
Signed-off-by: Yueqian Lin <pandaleefree@gmail.com> Signed-off-by: Yueqian Lin <70319226+linyueqian@users.noreply.github.com> Co-authored-by: vveerrgg <vveerrgg@users.noreply.github.com>
This commit is contained in:
1 parent
fcda835f4d
commit
2c6c07c4f6
2 files changed
+24
No files matched your search
@@ -385,3 +385,18 @@ class TestStreamingSpeechWebSocket:
|
||||
|
||||
speech_service.engine_client.abort.assert_awaited_once_with("req-abort")
|
||||
assert websocket.send_json.await_count == 2
|
||||
|
||||
|
||||
class TestGeneratePcmChunksContract:
|
||||
"""Guard: _generate_pcm_chunks must exist on OmniOpenAIServingSpeech.
|
||||
|
||||
The WebSocket handler calls speech_service._generate_pcm_chunks()
|
||||
at runtime. If the method is removed, all WS TTS streaming breaks
|
||||
with an AttributeError. This test catches that at CI time.
|
||||
"""
|
||||
|
||||
def test_generate_pcm_chunks_defined(self):
|
||||
assert hasattr(OmniOpenAIServingSpeech, "_generate_pcm_chunks")
|
||||
assert asyncio.iscoroutinefunction(OmniOpenAIServingSpeech._generate_pcm_chunks) or callable(
|
||||
OmniOpenAIServingSpeech._generate_pcm_chunks
|
||||
)
|
||||
Reference in new issue
Block a user