kaxil commented on a change in pull request #10677:
URL: https://github.com/apache/airflow/pull/10677#discussion_r482607325
##########
File path: tests/cli/commands/test_dag_command.py
##########
@@ -139,6 +140,19 @@ def test_show_dag_print(self):
self.assertIn("graph [label=example_bash_operator labelloc=t
rankdir=LR]", out)
self.assertIn("runme_2 -> run_after_loop", out)
+ def test_generate_dag_yaml(self):
+
+ directory = "/tmp/airflow_dry_run_test/"
+ file_name =
"example_bash_operator_run_after_loop_2020-11-03T00_00_00.yml"
+ if os.path.exists(directory):
+ shutil.rmtree(directory)
+ dag_command.generate_pod_yaml(self.parser.parse_args([
+ 'dags', 'generate_kubernetes_pod_yaml',
+ "--output-path", directory, 'example_bash_operator']))
+ self.assertEqual(len(os.listdir(directory)), 6)
+ self.assertTrue(os.path.isfile(directory + file_name))
+ self.assertNotEqual(os.stat(directory + file_name).st_size, 0)
Review comment:
you can use `assertGreater` here
https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertGreater
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]