Return empty task-token on no-task

To match the SWF documentation, an empty task is one where the
task-token is the empty string, rather than being a nonexistant key

Signed-off-by: Laurie O <laurie_opperman@hotmail.com>
This commit is contained in:
Laurie O 2020-02-26 00:19:39 +10:00
commit 002683fd13
No known key found for this signature in database
GPG key ID: AAA23A02196FC956
3 changed files with 12 additions and 6 deletions

View file

@ -423,7 +423,9 @@ class SWFResponse(BaseResponse):
if decision:
return json.dumps(decision.to_full_dict(reverse_order=reverse_order))
else:
return json.dumps({"previousStartedEventId": 0, "startedEventId": 0})
return json.dumps(
{"previousStartedEventId": 0, "startedEventId": 0, "taskToken": ""}
)
def count_pending_decision_tasks(self):
domain_name = self._params["domain"]
@ -457,7 +459,7 @@ class SWFResponse(BaseResponse):
if activity_task:
return json.dumps(activity_task.to_full_dict())
else:
return json.dumps({"startedEventId": 0})
return json.dumps({"startedEventId": 0, "taskToken": ""})
def count_pending_activity_tasks(self):
domain_name = self._params["domain"]