Eason09053360 commented on code in PR #72810:
URL: https://github.com/apache/airflow/pull/72810#discussion_r3980088176
##########
airflow-core/tests/unit/cli/commands/test_dag_command.py:
##########
@@ -969,6 +970,23 @@ def test_dag_test_show_dag(self, mock_get_dag,
mock_render_dag, stdout_capture):
mock_render_dag.assert_has_calls([mock.call(mock_get_dag.return_value,
tis=[])])
assert "SOURCE" in output
+ @mock.patch("airflow.cli.commands.dag_command.render_dag", autospec=True)
+ @mock.patch.object(DAG, "test", autospec=True)
+ def test_dag_test_show_dag_from_dag_cli(self, mock_test, mock_render_dag,
dag_maker):
+ """``DAG.cli()`` passes the Dag positionally and its parser drops
``dag_id``."""
+ with dag_maker("dag_cli_show_dagrun", schedule=None) as dag:
+ EmptyOperator(task_id="only_task")
+ mock_test.return_value = dag_maker.create_dagrun(run_id="dag_cli_run")
+
+ parser = cli_parser.get_parser(dag_parser=True)
+ dag_command.dag_test(parser.parse_args(["dags", "test",
"--show-dagrun"]), dag)
Review Comment:
Applied :)
--
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]