hussein-awala commented on code in PR #35250:
URL: https://github.com/apache/airflow/pull/35250#discussion_r1375437436


##########
tests/cli/commands/test_dag_command.py:
##########
@@ -530,6 +530,22 @@ def test_cli_list_dags(self):
         assert "airflow/example_dags/example_complex.py" in out
         assert "- dag_id:" in out
 
+    @conf_vars({("core", "load_examples"): "true"})
+    def test_cli_list_dags_additional_comments(self):
+        args = self.parser.parse_args(
+            ["dags", "list", "--additional-columns", 
"last_parsed_time,is_subdag", "--output", "yaml"]
+        )
+        with contextlib.redirect_stdout(StringIO()) as temp_stdout:
+            dag_command.dag_list_dags(args)
+            out = temp_stdout.getvalue()
+        assert "owner" in out
+        assert "airflow" in out
+        assert "paused" in out
+        assert "last_parsed_time" in out
+        assert "is_subdag" in out
+        assert "airflow/example_dags/example_complex.py" in out
+        assert "- dag_id:" in out

Review Comment:
   It will be easier to test with JSON format 🤔 



##########
tests/cli/commands/test_dag_command.py:
##########
@@ -530,6 +530,22 @@ def test_cli_list_dags(self):
         assert "airflow/example_dags/example_complex.py" in out
         assert "- dag_id:" in out
 
+    @conf_vars({("core", "load_examples"): "true"})
+    def test_cli_list_dags_additional_comments(self):
+        args = self.parser.parse_args(
+            ["dags", "list", "--additional-columns", 
"last_parsed_time,is_subdag", "--output", "yaml"]
+        )
+        with contextlib.redirect_stdout(StringIO()) as temp_stdout:
+            dag_command.dag_list_dags(args)
+            out = temp_stdout.getvalue()
+        assert "owner" in out
+        assert "airflow" in out
+        assert "paused" in out
+        assert "last_parsed_time" in out
+        assert "is_subdag" in out
+        assert "airflow/example_dags/example_complex.py" in out
+        assert "- dag_id:" in out

Review Comment:
   It will be easier to test with JSON format 🤔 



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to