Exemple #1
0
 def test_add_run_date_option(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_CHS_currents_file.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")
     make_CHS_currents_file.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[0]
     assert args == ("run_type", )
     assert kwargs["choices"] == {"nowcast", "forecast", "forecast2"}
     assert "help" in kwargs
Exemple #3
0
 def test_run_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_CHS_currents_file.main()
     args, kwargs = m_worker().run.call_args
     assert args == (
         make_CHS_currents_file.make_CHS_currents_file,
         make_CHS_currents_file.success,
         make_CHS_currents_file.failure,
     )
Exemple #4
0
 def test_init_cli(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_CHS_currents_file.main()
     m_worker().init_cli.assert_called_once_with()
Exemple #5
0
 def test_instantiate_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_CHS_currents_file.main()
     args, kwargs = m_worker.call_args
     assert args == ("make_CHS_currents_file", )
     assert list(kwargs.keys()) == ["description"]