@@ -276,50 +276,6 @@ async def mock_build_request(workflow, args, options):
276276 assert captured_options .execution_start_to_close_timeout == timedelta (minutes = 30 )
277277
278278
279- class TestClientStartWorkflow :
280- """Test Client.start_workflow method."""
281-
282- @pytest .mark .asyncio
283- async def test_start_workflow_success (self , mock_client ):
284- """Test successful workflow start."""
285- # Mock the gRPC stub
286- execution = WorkflowExecution ()
287- execution .workflow_id = "test-workflow-id"
288- execution .run_id = "test-run-id"
289-
290- response = StartWorkflowExecutionResponse ()
291- response .run_id = "test-run-id"
292-
293- client = Client (domain = "test-domain" , target = "localhost:7933" )
294- client ._workflow_stub = Mock ()
295- client ._workflow_stub .StartWorkflowExecution = AsyncMock (return_value = response )
296-
297- result_execution = await client .start_workflow (
298- "TestWorkflow" ,
299- "arg1" , "arg2" ,
300- task_list = "test-task-list" ,
301- workflow_id = "test-workflow-id"
302- )
303-
304- assert isinstance (result_execution , WorkflowExecution )
305- assert result_execution .workflow_id == "test-workflow-id"
306- assert result_execution .run_id == "test-run-id"
307-
308- # Verify gRPC call was made
309- client ._workflow_stub .StartWorkflowExecution .assert_called_once ()
310-
311- @pytest .mark .asyncio
312- async def test_start_workflow_propagates_error (self , mock_client ):
313- """Test that start_workflow propagates gRPC errors."""
314- client = Client (domain = "test-domain" , target = "localhost:7933" )
315- client ._workflow_stub = Mock ()
316- client ._workflow_stub .StartWorkflowExecution = AsyncMock (side_effect = ValueError ("gRPC error" ))
317-
318- with pytest .raises (Exception , match = "Failed to start workflow" ):
319- await client .start_workflow (
320- "TestWorkflow" ,
321- task_list = "valid-task-list"
322- )
323279
324280
325281@pytest .mark .asyncio
0 commit comments