Ejemplo n.º 1
0
 def test_add_run_date_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_plots.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
Ejemplo n.º 2
0
 def test_add_plot_type_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_plots.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[2]
     assert args == ("plot_type", )
     assert kwargs["choices"] == {"publish", "research", "comparison"}
     assert "help" in kwargs
Ejemplo n.º 3
0
 def test_add_model_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_plots.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[0]
     assert args == ("model", )
     assert kwargs["choices"] == {"nemo", "fvcom", "wwatch3"}
     assert "help" in kwargs
Ejemplo n.º 4
0
 def test_add_run_type_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_plots.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[1]
     assert args == ("run_type", )
     assert kwargs["choices"] == {
         "nowcast",
         "nowcast-green",
         "nowcast-agrif",
         "nowcast-x2",
         "nowcast-r12",
         "forecast",
         "forecast2",
         "forecast-x2",
     }
     assert "help" in kwargs
Ejemplo n.º 5
0
 def test_run_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_plots.main()
     args, kwargs = m_worker().run.call_args
     assert args == (make_plots.make_plots, make_plots.success,
                     make_plots.failure)
Ejemplo n.º 6
0
 def test_add_test_figure_arg(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_plots.main()
     args, kwargs = m_worker().cli.add_argument.call_args_list[3]
     assert args == ("--test-figure", )
     assert "help" in kwargs
Ejemplo n.º 7
0
 def test_init_cli(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_plots.main()
     m_worker().init_cli.assert_called_once_with()
Ejemplo n.º 8
0
 def test_instantiate_worker(self, m_worker):
     m_worker().cli = Mock(name="cli")
     make_plots.main()
     args, kwargs = m_worker.call_args
     assert args == ("make_plots", )
     assert list(kwargs.keys()) == ["description"]