@@ -27,28 +27,33 @@ def test_random_orchestrator_initialization(orchestrator_config):
2727
2828@pytest .mark .asyncio
2929async def test_process_input (orchestrator_config ):
30- """Test the process_input task."""
30+ """Test the _process_input_activity task."""
3131 with patch ("dapr.ext.workflow.WorkflowRuntime" ) as mock_runtime :
3232 mock_runtime .return_value = MagicMock ()
3333 orchestrator = RandomOrchestrator (** orchestrator_config )
34+
35+ # Mock the activity context
36+ mock_ctx = MagicMock ()
3437 task = "test task"
35- result = await orchestrator .process_input ( task )
38+ result = orchestrator ._process_input_activity ( mock_ctx , { " task" : task } )
3639
3740 assert result ["role" ] == "user"
38- assert result ["name" ] == "test_orchestrator "
41+ assert result ["name" ] == "user "
3942 assert result ["content" ] == task
4043
4144
4245def test_select_random_speaker (orchestrator_config ):
43- """Test the select_random_speaker task."""
46+ """Test the _select_random_speaker_activity task."""
4447 with patch ("dapr.ext.workflow.WorkflowRuntime" ) as mock_runtime , patch .object (
4548 RandomOrchestrator ,
46- "get_agents_metadata " ,
49+ "list_team_agents " ,
4750 return_value = {"agent1" : {"name" : "agent1" }, "agent2" : {"name" : "agent2" }},
4851 ):
4952 mock_runtime .return_value = MagicMock ()
5053 orchestrator = RandomOrchestrator (** orchestrator_config )
5154
52- speaker = orchestrator .select_random_speaker ()
55+ # Mock the activity context
56+ mock_ctx = MagicMock ()
57+ speaker = orchestrator ._select_random_speaker_activity (mock_ctx )
58+
5359 assert speaker in ["agent1" , "agent2" ]
54- assert orchestrator .current_speaker == speaker
0 commit comments