You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/12/22 20:18:15 UTC

[GitHub] [airflow] mik-laj commented on issue #6875: [AIRFLOW-6076] Fix dag.cli() Key error

mik-laj commented on issue #6875: [AIRFLOW-6076] Fix dag.cli() Key error
URL: https://github.com/apache/airflow/pull/6875#issuecomment-568299821
 
 
   Hi. I don't think we want to delete this feature. However, fixing this feature will be very difficult. From what I've looked at, it's easiest to do another CLI that will contain only a small set of commands. You also asked how you can test these CLIs. Here I attach an example code of test.
   ```
   class TestDagCli(unittest.TestCase):
       def test_should_display_list_command(self):
           from airflow.example_dags import example_bash_operator
   
           with contextlib.redirect_stdout(io.StringIO()) as temp_stdout, \
               mock.patch('sys.argv', [example_bash_operator.__file__, "list_runs"]):
               example_bash_operator.dag.cli()
   
           stdout = temp_stdout.getvalue()
   
           self.assertEqual("TODO", stdout)
   
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services