Пример #1
0
 def test_add_run_date_option(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_ww3_current_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
Пример #2
0
 def test_add_run_type_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_ww3_current_file.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[1]
     assert args == ("run_type", )
     assert kwargs["choices"] == {"nowcast", "forecast", "forecast2"}
     assert "help" in kwargs
Пример #3
0
 def test_run_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_ww3_current_file.main()
     args, kwargs = m_worker().run.call_args
     expected = (
         make_ww3_current_file.make_ww3_current_file,
         make_ww3_current_file.success,
         make_ww3_current_file.failure,
     )
     assert args == expected
Пример #4
0
 def test_add_host_name_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_ww3_current_file.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[0]
     assert args == ("host_name", )
     assert "help" in kwargs
Пример #5
0
 def test_init_cli(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_ww3_current_file.main()
     m_worker().init_cli.assert_called_once_with()
Пример #6
0
 def test_instantiate_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_ww3_current_file.main()
     args, kwargs = m_worker.call_args
     assert args == ("make_ww3_current_file", )
     assert list(kwargs.keys()) == ["description"]