66from cadence .api .v1 .common_pb2 import WorkflowExecution
77from cadence .api .v1 .service_workflow_pb2 import StartWorkflowExecutionRequest , StartWorkflowExecutionResponse
88from cadence .api .v1 .workflow_pb2 import WorkflowIdReusePolicy
9- from cadence .client import Client , StartWorkflowOptions , WorkflowRun
9+ from cadence .client import Client , StartWorkflowOptions
1010from cadence .data_converter import DefaultDataConverter
1111
1212
@@ -64,32 +64,6 @@ def test_custom_values(self):
6464 assert options .search_attributes == {"attr" : "value" }
6565
6666
67- class TestWorkflowRun :
68- """Test WorkflowRun class."""
69-
70- def test_properties (self , mock_client ):
71- """Test WorkflowRun properties."""
72- execution = WorkflowExecution ()
73- execution .workflow_id = "test-workflow-id"
74- execution .run_id = "test-run-id"
75-
76- workflow_run = WorkflowRun (execution = execution , client = mock_client )
77-
78- assert workflow_run .workflow_id == "test-workflow-id"
79- assert workflow_run .run_id == "test-run-id"
80- assert workflow_run .client is mock_client
81-
82- @pytest .mark .asyncio
83- async def test_get_result_not_implemented (self , mock_client ):
84- """Test that get_result raises NotImplementedError."""
85- execution = WorkflowExecution ()
86- execution .workflow_id = "test-workflow-id"
87- execution .run_id = "test-run-id"
88-
89- workflow_run = WorkflowRun (execution = execution , client = mock_client )
90-
91- with pytest .raises (NotImplementedError , match = "get_result not yet implemented" ):
92- await workflow_run .get_result ()
9367
9468
9569class TestClientBuildStartWorkflowRequest :
@@ -316,17 +290,16 @@ async def test_execute_workflow_success(self, mock_client):
316290 client = Client (domain = "test-domain" , target = "localhost:7933" )
317291 client .start_workflow = AsyncMock (return_value = execution )
318292
319- workflow_run = await client .execute_workflow (
293+ result_execution = await client .execute_workflow (
320294 "TestWorkflow" ,
321295 "arg1" , "arg2" ,
322296 task_list = "test-task-list"
323297 )
324298
325- assert isinstance (workflow_run , WorkflowRun )
326- assert workflow_run .execution is execution
327- assert workflow_run .client is client
328- assert workflow_run .workflow_id == "test-workflow-id"
329- assert workflow_run .run_id == "test-run-id"
299+ assert isinstance (result_execution , WorkflowExecution )
300+ assert result_execution is execution
301+ assert result_execution .workflow_id == "test-workflow-id"
302+ assert result_execution .run_id == "test-run-id"
330303
331304 # Verify start_workflow was called with correct arguments
332305 client .start_workflow .assert_called_once_with (
@@ -361,7 +334,7 @@ async def test_integration_workflow_invocation():
361334 client ._workflow_stub .StartWorkflowExecution = AsyncMock (return_value = response )
362335
363336 # Test the complete flow
364- workflow_run = await client .execute_workflow (
337+ execution = await client .execute_workflow (
365338 "IntegrationTestWorkflow" ,
366339 "test-arg" ,
367340 42 ,
@@ -372,8 +345,8 @@ async def test_integration_workflow_invocation():
372345 )
373346
374347 # Verify result
375- assert workflow_run .workflow_id == "integration-workflow-id"
376- assert workflow_run .run_id == "integration-run-id"
348+ assert execution .workflow_id == "integration-workflow-id"
349+ assert execution .run_id == "integration-run-id"
377350
378351 # Verify the gRPC call was made with proper request
379352 client ._workflow_stub .StartWorkflowExecution .assert_called_once ()
0 commit comments