Exemple #1
0
 def test_add_run_date_option(self, m_worker):
     m_worker().cli = Mock(name="cli")
     run_NEMO_agrif.main()
     args, kwargs = m_worker().cli.add_date_option.call_args_list[0]
     assert args == ("--run-date", )
     assert kwargs["default"] == arrow.now().floor("day")
     assert "help" in kwargs
Exemple #2
0
 def test_add_run_type_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     run_NEMO_agrif.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[1]
     assert args == ("run_type", )
     assert kwargs["choices"] == {"nowcast-agrif"}
     assert "help" in kwargs
Exemple #3
0
 def test_run_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     run_NEMO_agrif.main()
     args, kwargs = m_worker().run.call_args
     assert args == (
         run_NEMO_agrif.run_NEMO_agrif,
         run_NEMO_agrif.success,
         run_NEMO_agrif.failure,
     )
Exemple #4
0
 def test_add_host_name_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     run_NEMO_agrif.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[0]
     assert args == ("host_name", )
     assert "help" in kwargs
Exemple #5
0
 def test_init_cli(self, m_worker):
     m_worker().cli = Mock(name="cli")
     run_NEMO_agrif.main()
     m_worker().init_cli.assert_called_once_with()
Exemple #6
0
 def test_instantiate_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     run_NEMO_agrif.main()
     args, kwargs = m_worker.call_args
     assert args == ("run_NEMO_agrif", )
     assert list(kwargs.keys()) == ["description"]