jedcunningham commented on a change in pull request #18642:
URL: https://github.com/apache/airflow/pull/18642#discussion_r720333862
##########
File path: tests/api_connexion/endpoints/test_task_instance_endpoint.py
##########
@@ -1129,6 +1129,37 @@ def test_should_raise_404_not_found_dag(self):
)
assert response.status_code == 404
+ @mock.patch('airflow.models.dag.DAG.set_task_instance_state')
+ def test_should_raise_not_found_if_execution_date_is_wrong(self,
mock_set_task_instance_state, session):
+ self.create_task_instances(session)
+ mock_set_task_instance_state.return_value = (
+ session.query(TaskInstance)
+ .join(TaskInstance.dag_run)
+ .options(contains_eager(TaskInstance.dag_run))
+ .filter(TaskInstance.task_id == "print_the_context")
+ .all()
+ )
Review comment:
Do we need to set up the mock return since we are short circuiting
anyways?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]