Skip to content

Commit

Permalink
minor: review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon committed Oct 19, 2023
1 parent e1817da commit b0cdb91
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions gcloud/tests/taskflow3/tasks/test_send_taskflow_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,17 @@ def generate_taskflow(cls):

def test_send_taskflow_message(self):

get_task_status = MagicMock()
taskflow = MagicMock()
taskflow.id = 1
taskflow_model = MagicMock()
taskflow_model.objects.get = MagicMock(return_value=taskflow)

send_task_flow_message = MagicMock()
with patch(TASKFLOW_TASKS_TASKFLOW_INSTANCE, taskflow_model):
with patch(TASKFLOW_TASKS_TASK_COMMAND_DISPATCHER_GET_STATUS, get_task_status):
with patch(TASKFLOW_TASKS_SEND_TASK_FLOW_MESSAGE, send_task_flow_message):
send_taskflow_message(taskflow.id, ATOM_FAILED, node_name="test")
with patch(TASKFLOW_TASKS_SEND_TASK_FLOW_MESSAGE, send_task_flow_message):
send_taskflow_message(taskflow.id, ATOM_FAILED, node_name="test")

send_task_flow_message.assert_called_once_with(taskflow, ATOM_FAILED, "test")
get_task_status.assert_not_called()
taskflow_model.objects.get.assert_called_once_with(id=taskflow.id)

def test_send_taskflow_message__use_root(self):
Expand Down

0 comments on commit b0cdb91

Please sign in to comment.