test: bunch of tests
Written with AI, still need to check them ref: N25B-449
This commit is contained in:
@@ -36,7 +36,12 @@ async def test_transcription_agent_flow(mock_zmq_context):
|
||||
agent.send = AsyncMock()
|
||||
|
||||
agent._running = True
|
||||
agent.add_behavior = AsyncMock()
|
||||
|
||||
def close_coro(coro):
|
||||
coro.close()
|
||||
return MagicMock()
|
||||
|
||||
agent.add_behavior = MagicMock(side_effect=close_coro)
|
||||
|
||||
await agent.setup()
|
||||
|
||||
@@ -143,7 +148,12 @@ async def test_transcription_loop_continues_after_error(mock_zmq_context):
|
||||
agent = TranscriptionAgent("tcp://in")
|
||||
agent._running = True # ← REQUIRED to enter the loop
|
||||
agent.send = AsyncMock() # should never be called
|
||||
agent.add_behavior = AsyncMock() # match other tests
|
||||
|
||||
def close_coro(coro):
|
||||
coro.close()
|
||||
return MagicMock()
|
||||
|
||||
agent.add_behavior = MagicMock(side_effect=close_coro) # match other tests
|
||||
|
||||
await agent.setup()
|
||||
|
||||
@@ -180,7 +190,12 @@ async def test_transcription_continue_branch_when_empty(mock_zmq_context):
|
||||
# Make loop runnable
|
||||
agent._running = True
|
||||
agent.send = AsyncMock()
|
||||
agent.add_behavior = AsyncMock()
|
||||
|
||||
def close_coro(coro):
|
||||
coro.close()
|
||||
return MagicMock()
|
||||
|
||||
agent.add_behavior = MagicMock(side_effect=close_coro)
|
||||
|
||||
await agent.setup()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user