Exemplo n.º 1
0
 def test_add_data_date_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     update_forecast_datasets.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
Exemplo n.º 2
0
 def test_add_run_type_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     update_forecast_datasets.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[1]
     assert args == ("run_type", )
     assert kwargs["choices"] == {"forecast", "forecast2"}
     assert "help" in kwargs
Exemplo n.º 3
0
 def test_add_model_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     update_forecast_datasets.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[0]
     assert args == ("model", )
     assert kwargs["choices"] == {"fvcom", "nemo", "wwatch3"}
     assert "help" in kwargs
Exemplo n.º 4
0
 def test_run_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     update_forecast_datasets.main()
     args, kwargs = m_worker().run.call_args
     expected = (
         update_forecast_datasets.update_forecast_datasets,
         update_forecast_datasets.success,
         update_forecast_datasets.failure,
     )
     assert args == expected
Exemplo n.º 5
0
 def test_init_cli(self, m_worker):
     m_worker().cli = Mock(name="cli")
     update_forecast_datasets.main()
     m_worker().init_cli.assert_called_once_with()
Exemplo n.º 6
0
 def test_instantiate_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     update_forecast_datasets.main()
     args, kwargs = m_worker.call_args
     assert args == ("update_forecast_datasets", )
     assert "description" in kwargs