55
66import pytest
77from unittest .mock import Mock , AsyncMock , patch , PropertyMock
8- from typing import Dict , Any
98
109from cadence .api .v1 .common_pb2 import Payload
1110from cadence .api .v1 .service_worker_pb2 import (
1211 PollForDecisionTaskResponse ,
13- RespondDecisionTaskCompletedRequest ,
14- RespondDecisionTaskFailedRequest
12+ RespondDecisionTaskCompletedRequest
1513)
1614from cadence .api .v1 .workflow_pb2 import DecisionTaskFailedCause
1715from cadence .api .v1 .decision_pb2 import Decision
1816from cadence .client import Client
1917from cadence .worker ._decision_task_handler import DecisionTaskHandler
2018from cadence .worker ._registry import Registry
21- from cadence .workflow import WorkflowInfo
2219from cadence ._internal .workflow .workflow_engine import WorkflowEngine , DecisionResult
2320
2421
@@ -268,8 +265,8 @@ async def test_respond_decision_task_completed_success(self, handler, sample_dec
268265 assert isinstance (call_args , RespondDecisionTaskCompletedRequest )
269266 assert call_args .task_token == sample_decision_task .task_token
270267 assert call_args .identity == handler ._identity
271- assert call_args .return_new_decision_task == True
272- assert call_args .force_create_new_decision_task == True
268+ assert call_args .return_new_decision_task
269+ assert call_args .force_create_new_decision_task
273270 assert len (call_args .decisions ) == 2
274271 # query_results should not be set when None
275272 assert not hasattr (call_args , 'query_results' ) or len (call_args .query_results ) == 0
@@ -285,8 +282,8 @@ async def test_respond_decision_task_completed_no_query_results(self, handler, s
285282 await handler ._respond_decision_task_completed (sample_decision_task , decision_result )
286283
287284 call_args = handler ._client .worker_stub .RespondDecisionTaskCompleted .call_args [0 ][0 ]
288- assert call_args .return_new_decision_task == False
289- assert call_args .force_create_new_decision_task == False
285+ assert not call_args .return_new_decision_task
286+ assert not call_args .force_create_new_decision_task
290287 assert len (call_args .decisions ) == 0
291288 # query_results should not be set when None
292289 assert not hasattr (call_args , 'query_results' ) or len (call_args .query_results ) == 0
0 commit comments